Master Computers and Technology with Fun Quizzes & Brain Teasers!

In this lab, you use the flowchart and pseudocode found in the figures below to add code to a partially created C++ program. When completed, college admissions officers should be able to use the C++ program to determine whether to accept or reject a student, based on his or her test score and class rank.start input testScore,classRank if testScore >= 90 then if classRank >= 25 then output "Accept"else output "Reject" endif else if testScore >= 80then if classRank >= 50 then output "Accept" else output "Reject" endifelse if testScore >= 70then if classRank >= 75 then output "Accept"else output "Reject"endif else output "Reject"endifendifendifstopStudy the pseudocode in picture above. Write the interactive input statements to retrieve: A students test score (testScore) A student's class rank (classRank) The rest of the program is written for you. Execute the program by clicking "Run Code." Enter 87 for the test score and 60 for the class rank. Execute the program by entering 60 for the test score and 87 for the class rank.[comment]: (3. Write the statements to convert the string representation of a students test score and class rank to the integer data type (testScore and classRank, respectively).)Function: This program determines if a student will be admitted or rejected. Input: Interactive Output: Accept or Reject*/ #include using namespace std; int main(){ // Declare variables// Prompt for and get user input// Test using admission requirements and print Accept or Rejectif(testScore >= 90){ if(classRank >= 25){ cout
In this exercise, you will write a class that represents how you spend your time during the week The class should have four double instance variables . . sleep fun School sports These variables will track the number of hours you spend doing each of these activites in a single day, respectively The class should also have the following methods A constructor that has no parameters public void setsleept double hours Sleep) public vold setFun(double hourstun public void set School(double hours School) public void set Sports (double hours Sports) mbate vota print Total) The constructor should initialize all of the instanco variables to 0 The methods that begin with "set" set the values of the corresponding instance variables to the value of the parameter The last method should print the total number of hours per week you spend doing each of these activities Note you will have to calculate the weekly hours by using the daily hours stored in the instance variables. It should also print the . . . . public void set School Buble hours School) Dublic void set Sports (double hours Sports) Dublic vota print Total The constructor should initialize all of the instance valables to o The methods that begin with "set" set the values of the corresponding instance variables to the value of the parameter The last method should point the total number of hours per week you spend doing each of these activities Note you will have to calculate the weekly hours by using the daily hours stored in the instance variables it should also print the total number of hours in the week accounted for and how many hours are left over Here is an example of the output of print Totate 3, chool - 8 = 2 and sports = 3 Weekly Totais STED School Dort Funt Ora Tot turto 0
1.The ___________ method adds a new element onto the end of the array.A.addB.inputC.appendD.len2.A(n) ____________ is a variable that holds many pieces of data at the same time.A.indexB.lengthC.arrayD.element3.A(n) ____________ is a piece of data stored in an array.A.elementB.lengthC.arrayD.index4.Where does append add a new element?A.To the end of an array.B.To the beginning of an array.C.To the middle of an array.D.In alphabetical/numerical order.5.Consider the following code that works on an array of integers:for i in range(len(values)): if (values[i] < 0): values[i] = values [i] * -1What does it do?A.Changes all positives numbers to negatives.B.Nothing, values in arrays must be positive.C.Changes all negative numbers to positives.D.Subtracts one from every value in the array.6.Which of the following is NOT a reason to use arrays?A.To quickly process large amounts of data.B.Organize information.C.To store data in programs.D.To do number calculations.7.Consider the following:stuff = ["dog", "cat", "frog", "zebra", "bat", "pig", "mongoose"]"frog" is ____________.A.an indexB.an elementC.a listD.a sum8._____________ is storing a specific value in the array.A.IndexingB.SummingC.AssigningD.Iterating9.Consider the following code:stuff = ["dog", "cat", "frog", "zebra", "bat", "pig", "mongoose"]print(stuff[3])What is output?A.zebraB.batC.frogD.['dog', 'cat', 'frog', 'zebra', 'bat', 'pig', 'mongoose']10.Consider the following code:tests = [78, 86, 83, 89, 92, 91, 94, 67, 72, 95]sum = 0for i in range(_____): sum = sum + tests[i]print("Class average: " + str((sum/_____)))What should go in the ____________ to make sure that the code correctly finds the average of the test scores?A.sumB.val(tests)C.len(tests)D.len(tests) - 1