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
Textbook Question
Chapter 1, Problem 8E
Write statements that can be used in a Java
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Description
Write a Java program to take the temperature from the user in Celsius, convert it into Fahrenheit and display it to the
user. You can use the following formula for this purpose:
F=9C/5+32
Where. Cis the temperature in Celsiuş and F is the temperature in Fahrenheit.
Note: You can assume that C and F are integer values.
Sample Input:1
Sample Output: 33
After calculating the ranking score according to the ALES (Academic Postgraduate Exam) score, foreign language score and graduation grade point average of the candidate applying for graduate education, write the program in JAVa, which will be able to enter the ranking on the screen. (All points are given over a hundred.)
JAVA Programming Language:
According to the American Heart Association, as you exercise you should periodically check your heart rate to ensure you are in your target zone. Your target zone is a range that is 50% to 85% of your maximum heart rate. The formula for calculating a persons maximum heart rate is 220 minus your age in years.
Write a program that reads the users current heart rate, birthday, and the current day (each consisting of month, day, and year). The program should calculate the persons age (in years), the person's maximum heart rate, and the person's target heart rate zone range.
Output the users age, current heart rate, target zone range. If their heart rate is in the target zone congratulate them, if it is out of their target zone warn them.
Required Methods (Write these first and use them in your algorithm): (your code, particularly for computeAge, must be 100% clear and documented - it's the core of this assignment!)
int computeAge(int birthMonth, int birthDay,…
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
Distance per Tank of Gas A car with a 20-gallon gas tank averages 23.5 miles per gallon when driven in town, an...
Starting Out with C++ from Control Structures to Objects (9th Edition)
3.12 (Date Create a class called Date that includes three pieces Of information as data
members—a month (type ...
C++ How to Program (10th Edition)
Assume that it references a newly created iterator for a list of String objects. Write code that uses the itera...
Starting Out with Java: From Control Structures through Data Structures (4th Edition) (What's New in Computer Science)
Explain the different aspects of the cost of a programming language.
Concepts of Programming Languages (11th Edition)
Write a for loop that displays every fifth number, zero through 100.
Starting Out with Java: From Control Structures through Objects (6th Edition)
Look at the following pseudocode. If it were a real program, what would it display? Declare Integer number = 5 ...
Starting Out with Programming Logic and Design (5th 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
- A bug collector collects bugs every day for 7 days. Write a program that keeps a running total of the number of bugs collected during the 7 days. The program should prompt the user to enter the number of bugs collected for each day. Finally, when the program is finished, the program should display the total number of bugs collected.using javaarrow_forwardin java codearrow_forwardTask: Loop, input, and variable review: objects not required. Write a Java program that can make change for a vending machine. Your program should take two numbers as input, one for the amount charged and one for the money given. You can assume both amounts are less than $10, and that the user will give more money than the amount due. Use the following U.S. coins: dollar, quarter, dime, nickel, penny. The program displays the number of each kind of coin to give back. Try to design your program so that it returns the fewest number of coins possible. Output of a sample program run: You bought something worth $1.25. You paid $2.10. Your change is: 0 dollar coins 3 quarters 1 dimes 0 nickels 0 penniesarrow_forward
- Enter a number: 5 Enter b number: 4 The value of 5 raised to the power of 4 is 625 Enter a number: 2 Enter b number: -4 The number b cannot be negative, try again (3) Write a Java program that prompts the user to enter a sentence (phrase), then it counts how many vowels and consonants in the sentence (phrase). The sentence (phrase) should be typed in by the user in response to a prompt message. Your program must consider the following specifications: Use Letter as the name of your class. Type your name and student number above the class declaration using a block/paragraph comment. Use documentation, comments and code style. Use significant and appropriate identifiers. Use appropriate data type for the variables. Here is a sample run of the program: Enter a string: Programming is fun The number of vowels is 5 The number of consonants is 11arrow_forwardlanguage: JAVA Color MixerThe colours red, blue, and yellow are known as the primary colours because they cannot be madeby mixing other colours. When you mix two primary colours, you get a secondary colour, as shownhere: When you mix red and blue, you get purple.When you mix red and yellow, you get orange.When you mix blue and yellow, you get green.Design a program that prompts the user to enter the names of two primary colours to mix. If theuser enters anything other than “red,” “blue,” or “yellow,” the program should display an errormessage. Otherwise, the program should display the name of the secondary colour that results.arrow_forwardPlease use Java as the languagearrow_forward
- This symbol marks the beginning of a comment in java a. # b. ** c. // d. $arrow_forwardLoop, input, and variable review: objects not required. Write a Java program that can make change for a vending machine. Your program should take two numbers as input, one for the amount charged and one for the money given. You can assume both amounts are less than $10, and that the user will give more money than the amount due. Use the following U.S. coins: dollar, quarter, dime, nickel, penny. The program displays the number of each kind of coin to give back. Try to design your program so that it returns the fewest number of coins possible. Output of a sample program run: You bought something worth $1.25. You paid $2.10. ================================= Your change is: 0 dollar coins 3 quarters 1 dimes 0 nickels 0 pennies ▪ Rubric: • Dollar coins used to calculate change • Input two numbers • Change due calculation • Correct change • Minimum coins correct change • Overall program operation Please paste a screenshot of a successful program run, and copy-and-paste the source code…arrow_forwardNote: Write a java program below: Question1: Sales Tax A program that calculates the total of a retail sale should ask the user for the following: The retail price of the item being purchased The sales tax rate Once these items have been entered, the program should calculate and display the following: The sales tax for the purchase The total of the salearrow_forward
- using java Write a program that asks for the names of three runners and the time, in minutes, it took each of them to finish a race. The program should display the names of the runners in the order that they finished.arrow_forwardJAVAarrow_forwardControl structures: In Java only please. Output the position of the largest number and the largest number in the squence a0, a1, a2....ak. For example, the largest number of the squence is 75, 226, 113, 340, 170, 85, 256, 128, 64, 32, 16, 8, 4, 2, 1 is 340, and it's position is 4. Test your program for the following values of x: 75, 111, 678, 732, 873, 2048, and 65535. Thank youarrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
The Top Down Approach to Software Development; Author: Christopher Kalodikis;https://www.youtube.com/watch?v=v9M8LA2uM48;License: Standard YouTube License, CC-BY