Write pseudocode for a program that reads a student record, consisting of the student’s first and last name, followed by a sequence of test scores and a sentinel of −1. The program should print the student’s average score. Then provide a trace table for this sample input:
Harry Morgan 94 71 86 95 -1
Trending nowThis is a popular solution!
Chapter 4 Solutions
Big Java Late Objects
Additional Engineering Textbook Solutions
Objects First with Java: A Practical Introduction Using BlueJ (6th Edition)
Starting Out with C++ from Control Structures to Objects (9th Edition)
Concepts Of Programming Languages
Starting Out with Java: From Control Structures through Data Structures (4th Edition) (What's New in Computer Science)
Java How to Program, Early Objects (11th Edition) (Deitel: How to Program)
Computer Science: An Overview (12th Edition)
- Eulers number e is used as the base of natural logarithm. It may be approximated using the formula e=1/0!+1/1!+1/2!…1/(n-1)!+1/n! When n is sufficiently large. Write a program that approximates e using a loop that terminates when the difference between the two successive values of e is less than 0.0000001.arrow_forwardThe GCD (Greatest Common Divisor) of two numbers is the largest positive integer number that divides both the numbers without leaving any remainder. Write a program that prompts the user to enter two positive integers and computes their GCD. For example. GCD of 30 and 45 is 15. Sample Run 1: Enter two integers: 30 45 GCD of 30 and 45 is 15 Sample Run 2: Enter two integers: 55 121 GCD of 55 and 121 is 11arrow_forwardcode in matlabarrow_forward
- veWrite a program that reads an unspecified number of scores (1 99) and displays the following report. Assume that the maximum number of scores is 10. Here is the sample run of the program: Enter ten numbers: 1 23 2 16 5 57 2 8 9 4 (Enter) The number of distinct number is 9 The distinct numbers are: 1,2,3,4,5,6,7,8,9 Below 20%: 1 Between 20% and 50% : 3,4,5 Above 50%: 6,7,8,9 JEarrow_forwardStatistics are often calculated with varying amounts of input data. Write a program that takes any number of non-negative integers as input, and outputs the average (using integer division) and max. A negative integer ends the input and is not included in the statistics. Ex: When the input is: 15 20 0 5 -1 the output is: 10 20 Assume that at least one non-negative integer is input.arrow_forward/*code Kth Largest Factor A positive integer d is said to be a factor of another positive integer N if when N is divided by d, the remainder obtained is zero. For example, for number 12, there are 6 factors 1, 2, 3, 4, 6, 12. Every positive integer k has at least two factors, 1 and the number k itself.Given two positive integers N and k, write a program to print the kth largest factor of N. Input Format: The input is a comma-separated list of positive integer pairs (N, k). Output Format: The kth highest factor of N. If N does not have k factors, the output should be 1. Constraints: 1<N<10000000000 1<k<600. You can assume that N will have no prime factors which are larger than 13..arrow_forward
- Write a code segment to read in temperatures until -1 and calculate the average. JAVAarrow_forwardThe course grades of 75 students from 5 courses are given in the form of a table. Write an algorithm that writes "cannot be entered" for those with an average of less than 40 course grades, and "can be entered" for 40 and above. (Please explain everything the program in details and please check whether the program runs or not by using q-basic64. 01:44arrow_forwardJavaarrow_forward
- Use python language. Write a program that asks the user to input any positive or negative integer then outputs the integer without the first and last digits. Note: Use int data type only. You are not allowed to use other data types such as string and array. Sample input: -1425 Sample output: -42 Sample input: 21987 Sample output: 198arrow_forwardWrite 4 different programs. These are simple modifications to original sample program given. The four tasks are: Try1: Change sample program to add user input and then add 64 to it. Try 2: change sample program to subtract second user input from first and print answer. Try 3: Change the Try 2 to further subtract 10 from the results. Try 3.1 and Try 3.2: If first number > second number than subtract else add If first number > second number than subtract. It first number < second number than add else set number to 9999. Try4: In Try 2: check if second number is smaller than first else again ask for input from user until second number is smaller and then continue to print the subtracted result.arrow_forwardPython Write a programmed that displays how population increases over time. Your program should ask the user to enter the starting population, a yearly increase, and many years to predict over. The program will display results in a neatly formatted table. When generating the table, you must use a loop of some sort to output the table.NOTE: When using a percentage value for each year, the population growth will not always yield a whole number.Therefore, your program should round to the nearest whole number since we cannot have a partial person.arrow_forward
- C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology PtrC++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage LearningProgramming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:Cengage
- Systems ArchitectureComputer ScienceISBN:9781305080195Author:Stephen D. BurdPublisher:Cengage Learning