a. Write a program to calculate the average score for uncertain number of students. 1. Define...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
a. Write a program to calculate the average score for uncertain number of students. 1. Define variables-score, student_no and sum 2. Use sentinel controlled structure to do the following: Ask user to input an integer as student score. Please do the error checking for the score. The range of score is between 0 and 100. If the score is not in the range, please display an error message and ask user to input a new score. Add the valid score to sum a. b. c. Repeat step a and b until user input a user defined sentinel value to stop the loop 3. Define a function to calculate the average - dividing sum by student_no. Please note that the average is float not integer. 4. Display the number of students, total points, and average (2 decimal places). 1b. Write a program to calculate the average score for certain number of student. 1. Define 10 elements integer array, and sum. 2. Use counter controlled structure to do the following: a. Use random generator to generate 10 integers between 0 and 100. b. Store the integers into array c. Add the score into sum. 3. Define a function to calculate the average - dividing sum by student_no. Please note that the average is float not integer. 4. Display the students' scores, total points, and average (2 decimal places). a. Write a program to calculate the average score for uncertain number of students. 1. Define variables-score, student_no and sum 2. Use sentinel controlled structure to do the following: Ask user to input an integer as student score. Please do the error checking for the score. The range of score is between 0 and 100. If the score is not in the range, please display an error message and ask user to input a new score. Add the valid score to sum a. b. c. Repeat step a and b until user input a user defined sentinel value to stop the loop 3. Define a function to calculate the average - dividing sum by student_no. Please note that the average is float not integer. 4. Display the number of students, total points, and average (2 decimal places). 1b. Write a program to calculate the average score for certain number of student. 1. Define 10 elements integer array, and sum. 2. Use counter controlled structure to do the following: a. Use random generator to generate 10 integers between 0 and 100. b. Store the integers into array c. Add the score into sum. 3. Define a function to calculate the average - dividing sum by student_no. Please note that the average is float not integer. 4. Display the students' scores, total points, and average (2 decimal places).
Expert Answer:
Answer rating: 100% (QA)
Here is a Python program that uses a sentinelcontrolled structure to determine the average score for ... View the full answer
Related Book For
Introduction To Statistics And Data Analysis
ISBN: 9780495118732
3rd Edition
Authors: Roxy Peck, Chris Olsen, Jay L. Devore
Posted Date:
Students also viewed these programming questions
-
2. Suppose there are n identical consumers, each with a utility function u(x, y) = ax = x+y. Each consumer has different disposable income w. The price of good x is p dollars, and the price of...
-
Placid Lake Corporation acquired 80 percent of the outstanding voting stock of Scenic, Inc., on January 1, 2020, when Scenic had a net book value of $540,000. Any excess fair value was assigned to...
-
You will be using arrays to track the golf scores for three players. Each of the three players will be playing one round of golf every day for one week. The program needs to track all the scores,...
-
Logistical Logistics Inc. (Logistical Logistics or the "Company") provides transportation and logistics services to customers throughout a network of offices in North America, South America, and...
-
The monthly demand function for x units of a product sold by a monopoly is p=8000-x dollars, and its average cost is C=4000+5x dollars. (a) Determine the quantity that will maximize profit. (b)...
-
This case is based on the statement of cash flows for Allison Corporation, illustrated in Exhibit 131. Use this statement to evaluate the companys ability to continue paying the current level of...
-
Estimate the electric power requirement, in \(\mathrm{kW}\), of a \(1400 \mathrm{ft}^{2}\) floor area (three-bedroom home) with three occupants. Using your home power estimate, predict the power...
-
Bob Jones owns a catering company that stages banquets and parties for both individuals and companies. The business is seasonal, with heavy demand during the summer months and year-end holidays and...
-
1. Apple Orchard Cafe has 12 FTEs, each employee is 1 FTE, 6 of these get paid $10/hour and 6 get paid $15/hour, and its revenue for April is $180,000. What should its daily total payroll cost be? (5...
-
1. Tesla uses lease accounting for automotive sales under its resale value guarantee program. Assume that instead of using lease accounting for automotive sales under its resale value guarantee...
-
Consider the following matrix A: 3 3 6 A = 2 5 -2 -1 1 -6 For each of the following vectors, determine whether the vector is in the column space of A. If so, demonstrate this by providing a vector x...
-
You notice that Coca-Cola has a stock price of \($62.90\) and EPS of \($2.37.\) Its competitor PepsiCo has EPS of \($7.30.\) But Jones Soda, a small batch craft soda producer, has a P/E ratio of 35....
-
What are real options?
-
What pieces of information are needed to forecast dividends per share?
-
What is the NPV rule?
-
What is the risk-free interest rate for a five-year maturity?
-
In 2023, A Ltd. sold merchandise to its subsidiary, B Company, for $80,000 at a gross profit rate of 30%. B Company was able to sell 60% of the merchandise to outsiders by the end of the fiscal...
-
Illini Company, Inc. Balance Sheet as of 12/31/20X0 Assets Current Assets: Cash $1,500,000 Accounts receivable, net 18,000 Inventory 50,000 Total current assets 1,568,000 Equipment 90,000 Goodwill...
-
The article First Year Academic Success: A Prediction Combining Cognitive and Psychosocial Variables for Caucasian and African American Students (Journal of College Student Development [1999]:...
-
Five hundred randomly selected working adults living in Calgary, Canada were asked how long, in minutes, their typical daily commute was (Calgary Herald Traffic Study, Ipsos, September 17, 2005). The...
-
The article The Relationship of Task and Ego Orientation to Sportsmanship Attitudes and the Perceived Legitimacy of Injurious Acts (Research Quarterly for Exercise and Sport [1991]: 7987) examined...
-
Find the number of recycle loops, the optimal number of tear streams, and the corresponding calculation sequence for the process flowsheet in Figure 7.38. Figure 7.38:- Figure 7.38 Process flowsheet....
-
Convert the process flowsheet in Figure 7.22 into a flowsheet for mass-balance simulation Task-1. List the model equations, the variables to be specified, and the variables to be calculated. Figure...
-
Given the feed streams and the parameters of the process units as shown in Figure 7.39, complete the simulation flowsheet for ASPEN PLUS and show the calculation sequence (i.e., complete the...
Study smarter with the SolutionInn App