Create a program that Determines the students average based

Create a program that Determines the student\'s average based on three test scores. determines and displays The student\'s passing/failing status. The program should: Set up floating point output format Prompt the user to enter the student Id and the three test scores Output the user response Test data entered by user for negative test scores, and store the result of test in boolean variable dataOk (True if values are Ok or false otherwise) If data entered is tested and is not negative (dataOk is true), then calculate the average (to 2 decimal places).If average is greater than or equal to 60 print message to output the calculated average and that student is passing. If score is less than 70 it Should add to the message \' but marginal\" Otherwise print the message that student is failing. If data entered is tested and is negative(dataOk is false), then you should tell the user that data is invalid. Score entered is less than zero. Make sure you use adequate data to test all branches of selection and submit the tested data with the program. Your program should be interactive ie use prompts, clear instructions for the user etc and Write your Name, Course, section number, and date on first line Write Program\'s Name, cpp (Give it your last name with the assignment number as a name) Explain what the program is to do along with any directions or instructions needed for program users Make sure that you use appropriate indentation, documentation for your program etc #include #include //For setprecision() using namespace std; int main() {float average;//Average of three test scores long studentID;//Student\'s identification number int test1;//Score for first test int test2;//Score for second test int test3;//Score for third test bool dataOK;//True it data is correct//Set up floating point output format .......//Get the data, prompt the user to enter the student Id and the three test scores ..........//Output the user response ..........//Test data entered by user for negative test scores and print average as steps shown above.//Write the remaining code

Solution

# include<stdio.h>

#include<conio.h>

int main()

{

float average ;

long studentid;

int test1;

int test2;

int test3;

bool dataOk;

printf(\"Enter the student id and three test scores \")

Scanf(\"%lu \ \" , studentid);

Scanf(\"%d \" , test1)

Scanf(\"%d \" , test2);

Scanf(\"%d\" , test3);

Printf(\"your responses are \" studentid , test1 , test2 , test3)

int average(test1, test2,test3)

{

int av = test1 + test2 + test3 /3;

}

return (av)

int pass(av)

{

if av < 45

{

printf(\" fail\")

else

printf(\"pass\")

}

printf(\" your average is \" , av);

getch()

 Create a program that Determines the student\'s average based on three test scores. determines and displays The student\'s passing/failing status. The program

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site