Java: An Introduction to Problem Solving and Programming (7th Edition)
7th Edition
ISBN: 9780133766264
Author: Walter Savitch
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Concept explainers
Textbook Question
Chapter 1.3, Problem 32STQ
Suppose you write a
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Can you use Python programming language to to this question?
Thanks
An instructor gives a series of exams during the semester in her math class. At the end of
the semester she drops each student's lowest test score before averaging the scores. She has
asked you to design a program that will read a student's test scores as input and calculate
the average with the lowest score dropped. Here is the algorithm that you developed:
Get the student's test scores.
Calculate the total of the scores.
Find the lowest score.
Subtract the lowest score from the total. This gives the adjusted total.
Divide the adjusted total by 1 less than the number of test scores. This is the adjusted average.
Display the average.
The test scores are in a text file named scores.txt and contains the following:
Mickey, 71.0, 42.0, 83.0
Donald, 94.0, 73.0, 72.0, 81.0
Minnie, 95.0, 85.0, 45.0, 55.0, 65.0
A sample run is as follows:
Enter a file containing floating point numbers: scores.txt
Test scores for Mickey: ['71.0', '42.0', '83.0']
Removed the lowest score of 42.0 for Mickey
The…
Write a program that calculates the equivalent resistance of a circuit. n electrical resistors with
resistance values R1, R2,.., Rn are said to be connected in parallel if the same voltage is applied
across each. Their equivalent resistance Reg is related to the values R1, R2, ...,
Rn by:
1
1
1
1
+
+...+
R R R,
R.
"eq
Write a program that prompts the user to enter the resistance of n resistors. The user should
be prompted continuously by using a while loop until a zero or negative value is entered (the
program should count the number of resistors n entered by the user and store the values in an
array). Use another separate loop to print the resistance values entered by the user and the
equivalent resistance Reg. Test your program with R1= 1 kn, R2= 2 kn, R3= 4 kQ and R4= 8 kQ.
Chapter 1 Solutions
Java: An Introduction to Problem Solving and Programming (7th Edition)
Ch. 1.1 - What are the two kinds of memory in a computer?Ch. 1.1 - What is software?Ch. 1.1 - What data would you give to a program that...Ch. 1.1 - What data would you give to a program that...Ch. 1.1 - What is the difference between a program written...Ch. 1.1 - Is Java a high-level language or a low-level...Ch. 1.1 - Is Java bytecode a high-level language or a...Ch. 1.1 - What is a compiler?Ch. 1.1 - What is a source program?Ch. 1.1 - What do you call a program that translates Java...
Ch. 1.2 - What would the following statement, when used in a...Ch. 1.2 - Write a statement or statements that can be used...Ch. 1.2 - Prob. 13STQCh. 1.2 - What is the meaning of the following line in the...Ch. 1.2 - Write a complete Java program that uses system....Ch. 1.2 - Suppose you define a class named YourClass in a...Ch. 1.2 - Prob. 17STQCh. 1.3 - What is a method?Ch. 1.3 - Prob. 19STQCh. 1.3 - Do all objects of the same class have the same...Ch. 1.3 - Prob. 21STQCh. 1.3 - Prob. 22STQCh. 1.3 - Prob. 23STQCh. 1.3 - Prob. 24STQCh. 1.3 - What is an algorithm?Ch. 1.3 - What is pseudocode?Ch. 1.3 - Prob. 27STQCh. 1.3 - Prob. 28STQCh. 1.3 - Prob. 29STQCh. 1.3 - Prob. 30STQCh. 1.3 - Prob. 31STQCh. 1.3 - Suppose you write a program that is supposed to...Ch. 1.4 - Prob. 33STQCh. 1.4 - Prob. 34STQCh. 1 - How does a computers main memory differ from its...Ch. 1 - Prob. 2ECh. 1 - Prob. 3ECh. 1 - How does machine language differ from Java?Ch. 1 - What would the following statements, when used in...Ch. 1 - Write a statement or statements that can be used...Ch. 1 - Write statements that can be used in a Java...Ch. 1 - Given a persons year of birth, the Birthday Wizard...Ch. 1 - Write statements that can be used in a Java...Ch. 1 - Prob. 11ECh. 1 - Prob. 12ECh. 1 - Prob. 13ECh. 1 - Prob. 14ECh. 1 - What attributes and behaviors would an object...Ch. 1 - Suppose that you have a numberxthat is greater...Ch. 1 - Prob. 17ECh. 1 - Prob. 18ECh. 1 - Prob. 19ECh. 1 - Prob. 20ECh. 1 - Obtain a copy of the Java program shown in Listing...Ch. 1 - Modify the Java program described in Practice...Ch. 1 - Prob. 3PCh. 1 - The following program will compile but it has...Ch. 1 - Programming Projects require more problem-solving...Ch. 1 - Write a complete program for the problem described...Ch. 1 - Prob. 3PPCh. 1 - Prob. 4PPCh. 1 - Write an applet program for the problem described...Ch. 1 - Prob. 6PP
Additional Engineering Textbook Solutions
Find more solutions based on key concepts
(Prime Numbers) A positive integer is prime if its divisible by only 1 and itself. For example, 2, 3, 5 and 7 a...
Java How To Program (Early Objects)
Practice Problem 8.5 (solution page 797) Write a wrapper function for sleep, called snooze, with the following ...
Computer Systems: A Programmer's Perspective (3rd Edition)
Run the hello, world program on your system. Experiment with leaving out parts of the program, to see what erro...
C Programming Language
What output would be produced in Self-Test Exercise 22 if the sign were replaced with
Absolute Java (6th Edition)
Describe the purpose of the eof member function.
Starting Out with C++: Early Objects
Male and Female Percentages Write a program that asks the user for the number of males and the number of female...
Starting Out with Java: From Control Structures through Objects (7th Edition) (What's New in Computer Science)
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- Write a program that generates a two-column table showing Fahrenheit temperatures from -40F to 120F and their equivalent Celsius temperatures. Each line in the table should be 5 degrees F more than the previous one. Both the Fahrenheit and Celsius temperatures should be accurate to 1 decimal place. Note......BOOK: Introduction to Java Programming and Data Structures, Comprehensive Version, Edition: 11th Author: Y. Daniel Liang Publisher: Pearson ISBN: 9780134670942arrow_forwardWhile carpet shopping for her living room, Carol Jones noticed that some carpet prices are per square yard, while others are per square foot. Carol wants a program that calculates and displays the area of a floor in both square feet and square yards. She will enter the floor’s measurements in feet. Desk-check your solution’s algorithm twice, using your own set of data.arrow_forwardWrite a program in python Zeller’s congruence is an algorithm developed by Christian Zeller to calculate the day of the week. The formula is h is the day of the week (0: Saturday, 1: Sunday, 2: Monday, 3: Tuesday, 4: Wednesday, 5: Thursday, 6: Friday). q is the day of the month. m is the month (3: March, 4: April, ..., 12: December). January and February are counted as months 13 and 14 of the previous year. j is the century (i.e., ⌊year/100⌋). k is the year of the century (i.e., year % 100). Write a program that prompts the user to enter a year, month, and day of the month, and then it displays the name of the day of the week. Sample runs of program are given below: Enter year: (e.g., 2008): 2013 Enter month: 1-12: 1 Enter the day of the month: 1-31: 25 Day of the week is Friday Enter year: (e.g., 2008): 2012 Enter month: 1-12: 5 Enter the day of the month: 1-31: 12 Day of the week is Saturdayarrow_forward
- The Research team led by Bernadette Wolowitz at Cal-tech University has discovered a new Amoeba that grows in the order of a Fibonacci series every month. They are exhibiting this amoeba in a national. conference. They want to know the size of the amoeba at a particular time instant. If a particular month's index is given, write a program to display the amoeba's size. For Example, the size of the amoeba on month 1, 2, 3, 4, 5, 6,... will be 0, 1, 1, 2, 3, 5, 8.... respectively.arrow_forwardTask 15 Write a Python program that takes a number and tells if it is a perfect number or not. [The input number has to be an INTEGER] Perfect Number: An integer number is said to be a perfect number if its factors, including 1 but not the number itself, sum to the number. Example01: Input: 6 Output: 6 is a perfect number Explanation: 6 have 4 divisors: 1, 2, 3, and 6. If we add all factors except itself, 6 = 1 + 2 + 3.arrow_forwardplease helparrow_forward
- Write a program that take 5 digit number as an input from the user and perform the following tasks:1. Split a number into digits.2. Find the sum of the all the digits in the number.3. Find the product of the all the digits in the number.4. Find maximum number with in the number along with position.5. Printing the digits in the reverse order.Note: Make user defined functions to perform each task.arrow_forwardProblem 7: Guess the price of the car!? You will implement a variant of the number guessing game we played in lecture. In this variant, you will ask the user to guess the price of a $42,500 car. Let's assume that the player knows the price of the car is rounded to the nearest $500. If a player's guess is not exactly correct, your program will tell them they are either too high or too low. The player will get as many guesses as they need to guess the price of the $42,500 car. However they will only win the game if they used 5 or fewer guesses. Here are two examples of how the program should work for both cases: Guess the price and win the prize! Enter your guess:50000 Too high! Enter your guess:40000 Too low! Enter your guess:45000 Too high! Enter your guess:42500 You won the car! Guess the price and win the prize! Enter your guess:46000 Too high! Enter your guess:45000 Too high! Enter your guess:44000 Too high! Enter your guess:43000 Too high! Enter your guess:42000 Too low! Enter your…arrow_forwardAirline companies apply baggage restrictions for their passengers. An airline company has decided to apply a 10kg limitation for passengers' hand luggage and 20kg for their normal baggage. When passengers arrive, they enter their hand and normal luggage weight from the keyboard. If passengers exceed their normal baggage allowance of 10 dollars per gram, they pay 12 dollars per kg. Accordingly, write the program that calculates the baggage price of the airline they will go to according to the baggage values entered by the arriving passenger and keeps this from closing the program for each passenger. Note: If hand and normal baggage allowances are stretched below the maximum value, the payment amount will be considered not negative. An example printout is given on the right. Geri bildirim gönderarrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage Learning
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Introduction to Operators in C; Author: Neso Academy;https://www.youtube.com/watch?v=50Pb27JoUrw;License: Standard YouTube License, CC-BY