Average Scores Calculation

The best part about our site GetIntoCode is that we provide our followers to practice their skills because Practice Puts Brain in Your Muscles. So, Go Ahead and Write a C++, java or program in any language.

Problem Statement:

Calculate the average of three (3) scores/marks, program must take input from user to enter the scores/marks of each test. Assumed the total marks of each test is 100, print the output on screen.

Prerequisite:
You should have basic following knowledge of your language

  • Basic Syntax
  • Creation of Data variables
  • Print message over screen
  • Getting Input from user
  • If Statement to check score validity
  • While loop to avoid code repetition

Pseudo Code:
Here is the pseudo code to solve above problem

  1. Create three different integer variable to store score/marks of each test.
    • score_1
    • score_2
    • score_3
  2. Show message to user & get input & check the input should be between 0 &100
    • Enter the marks of first test 
      • Then get the input from user and store it in first variable
    • Enter the marks of second test
      • Store the second input  from user in second variable
    • Enter the marks of third test
      • Store the third input from user in third variable
    • If value isn't between 0 & 100 show the error message
  3. Create variable with the name average_score
  4. Sum all three variables and divide it by three 3 as (score_1+score_2+score_3)/3
  5. Store the result in average_score
  6. Print the result over the screen.
Note: Any Program can be written with different logic, you can create your own logic and can have different names of variable and can print different messages, it's totally depends over the programmer.

No comments

Powered by Blogger.