mike

mike

Lv3

University of Guelph

1 Follower
0 Following
0 Helped

ANSWERS

Published7

Subjects

English1Algebra1Computer Science4Calculus1

In this lab you will define a structure definition called Student, which will contain a string for the student’s name, and an integer array of size 3 called tests that will hold the values of that particular student’s test scores. You will write a user controlled looping program that will instantiate a Student object, prompt the user for the student’s name, and enter the student’s three test scores. The program will then display the student’s name, followed by the three test scores, the average of the tests up to 1 decimal point, and the corresponding letter grade. Then ask the user to type in “Y” if the user wishes to enter another student (then repeat), otherwise end the loop and let the program close. Define and use the following functions with in your program: Student getStudent(); - This function will create a temporary Student object, prompt the user for the student’s name and input in the the object’s member string variable. Then prompt for three test scores and enter into the object’s integer array tests for each score, validating that the score is with in 0..100. Then return the temporary object. void displayStudent(const Student &s); - This function will access and print out the passed student’s name and then call displayStudentDetails function. void displayStudentDetails(const int[], const int); - This function will pass the student’s tests array and the amount of tests the student has taken. This function will traverse the passed array, keeping a running total for each test score value and outputting each test score. This function will then call calcAverage passing the accumulated total and the number of tests the student has taken, assigning the returned value to a local double variable called avg. Display the avg up to 1 decimal point. Finally, call the function displayStudentLetterGrade passing the returned value avg. double calcAverage(const Student, int count); - This function will calculate and return the quotient of the total / count. (hint: remember to typecast as a double in order to return a double) doub le calcAverage(int total, int count); - This function will calculate and return the quotient of the total / count. (hint: remember to typecast as a double in order to return a double) void displayStudentLetterGrade(double avg); - This function will display the corresponding letter grade value given the passed avg. If the avg is >= 90 then print to the screen “A” … and so on. Expert Answer

Answer: Step-by-step explanation:struct Student { string name; int tests[3];};...
Answer: SELECT *FROM projectsWHERE start_year = 2020 AND EXISTS ( SELECT 1 FRO...

Have a look at the Java 14 ArrayList documentation:
https://docs.oracle.com/en/java/javase/14/docs/api/java.base/java/util/ArrayList.html

Imagine you developed this data structure and wanted to test it with the following standards:

- every method that returns a boolean should have at least 3 unit tests, one for a 'true' case, one for a 'false' case and one trivial 'corner case'
- every constructor should have at least 2 unit tests
- every other method (whether they return void or an Object or anything else) should have at least 4 unit tests

Then (at least) how many unit tests should you use to sufficiently test Java's ArrayList? Ensure that "All Methods" is selected when you are looking at the list of ArrayList methods. 

Answer: Step-by-step explanation: According to the standards provided, the num...
Answer: To find the function f that satisfies the given conditions, we can use...
Answer:Disgraced is a play by Ayad Akhtar that premiered in 2012. The play exp...
Answer: Step-by-step explanation: To show that f(a) = f'(a) = 0 if and only if...
Answer: Symmetric session key will require one bit added each year because the...

Weekly leaderboard

Start filling in the gaps now
Log in