Starting Out with Java: From Control Structures through Data Structures (4th Edition) (What's New in Computer Science)
4th Edition
ISBN: 9780134787961
Author: Tony Gaddis, Godfrey Muganda
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Textbook Question
Chapter 2, Problem 11AW
Convert the following pseudocode to Java code. Be sure to declare the appropriate variables.
Store 20 in the speed variable.
Store 10 in the time variable.
Multiply speed by time and store the result in the distance variable.
Display the contents of the distance variable.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Remaining Time: 54 minutes, 49 seconds.
* Question Completion Status:
QUESTION 19
Write a Java program that prompts the user to enter the School Grade Level of a student and
then calculate their discount amount in the regular fees structure offered during this pandemic
situation. By using the below table, calculate their discount amount from the amount of the
regular fee and then print the discount amount in OMR by using the appropriate selection
structure. (Assume the user is entering a maximum Grade level is 12)
discount amount = Regular Fees * percentage of discount rate
School Grade Level
Regular Fees in OMR
Discount Rate
>9 and 6 and 3 and 0 and <=3
30.500
5%
otherwise
20.400
No discount
T T T Arial
3 (12pt)
v T -E E-
只i ン
Click Save and Submit to save and submit. Click Save All Answers to save all answers.
Save All Answers
TOSHIBA
F5
F6
F7
F8
F9
F10
F11
F12
INS
SCNULL LOCK
AD
&
67
7
V 8A9 4 0
Us------c.
Prak 9 Instructions PDF
-mming
Prak 9
Chapter 6: Modularizing Your Code with Methods
1. Salesperson's Commission Calculator (Nr 1, Page 408)
Create an application that lets the user enter a salesperson's revenue sale and the rate of
commission paid by the company, and display the commission earned. For example:
• If a salesperson sells $100,000 in revenue while working with a company that pays 5
percent of the revenue, his/her commission check will be $5,000.
• if a salesperson sells $100,000 in revenue while working with a company that pays 8
percent of the revenuo, his/her commission check will be $8,000.
The program should have a method named CalculateDisplayCommission that receives the
revenue sale by a salesperson and the commission percentage as arguments, and calculates
and displays the commission earned by the salesman.
See examples below:
Salesperson's Commis.
|Salesperson's Commis.
100000
Revenue Sale:
100000
Revenue Sale:
Commission Percentage:
Commission…
True or false: Java variables cannot start with a capital letter.
Chapter 2 Solutions
Starting Out with Java: From Control Structures through Data Structures (4th Edition) (What's New in Computer Science)
Ch. 2.1 - Prob. 2.1CPCh. 2.1 - When the program in Question 2.1 is saved to a...Ch. 2.1 - Complete the following program skeleton so it...Ch. 2.1 - On paper, write a program that will display your...Ch. 2.1 - Prob. 2.5CPCh. 2.1 - Every Java application program must have...Ch. 2.2 - The following program will not compile because the...Ch. 2.2 - Study the following program and show what it will...Ch. 2.2 - On paper, write a program that will display your...Ch. 2.3 - Examine the following program. // This program...
Ch. 2.3 - What will the following program display on the...Ch. 2.4 - Which of the following are illegal variable names...Ch. 2.4 - Prob. 2.13CPCh. 2.4 - Prob. 2.14CPCh. 2.4 - Prob. 2.15CPCh. 2.4 - A program declares a float variable named number,...Ch. 2.4 - Prob. 2.17CPCh. 2.4 - Prob. 2.18CPCh. 2.4 - Prob. 2.19CPCh. 2.4 - Prob. 2.20CPCh. 2.4 - What is wrong with the following statement? char...Ch. 2.5 - Prob. 2.22CPCh. 2.5 - Prob. 2.23CPCh. 2.6 - Write statements using combined assignment...Ch. 2.7 - The following declaration appears in a program:...Ch. 2.7 - The variable a is a float and the variable b is a...Ch. 2.9 - Write a statement that declares a String variable...Ch. 2.9 - Assume that stringLength is an int variable. Write...Ch. 2.9 - Prob. 2.29CPCh. 2.9 - Prob. 2.30CPCh. 2.9 - Prob. 2.31CPCh. 2.11 - Prob. 2.32CPCh. 2.11 - How are documentation comments different from...Ch. 2.14 - Prob. 2.34CPCh. 2.14 - Write code that will display each of the dialog...Ch. 2.14 - Write code that displays an input dialog asking...Ch. 2.14 - Prob. 2.37CPCh. 2 - Every complete statement ends with a __________....Ch. 2 - The following data 72 'A' Hello World 2.8712 are...Ch. 2 - A group of statements, such as the contents of a...Ch. 2 - Which of the following are not valid assignment...Ch. 2 - Which of the following are nor valid println...Ch. 2 - The negation operator is __________. a. unary b....Ch. 2 - This key word is used to declare a named constant....Ch. 2 - These characters mark the beginning of a...Ch. 2 - These characters mark the beginning of a...Ch. 2 - These characters mark the beginning of a...Ch. 2 - Which Scanner class method would you use to read a...Ch. 2 - Which Scanner class method would you use to read a...Ch. 2 - You can use this class to display dialog boxes. a....Ch. 2 - Prob. 14MCCh. 2 - Prob. 15MCCh. 2 - True or False: A left brace in a Java program is...Ch. 2 - True or False: A variable must be declared before...Ch. 2 - True or False: Variable names may begin with a...Ch. 2 - True or False: You cannot change the value of a...Ch. 2 - True or False: Comments that begin with / / can be...Ch. 2 - True or False: If one of an operators operands is...Ch. 2 - What will the following code segments print on the...Ch. 2 - int x = 0, y=2; x = y 4; System.out.println(x +...Ch. 2 - System.out.print(I am the incredible);...Ch. 2 - System.out.print(Be careful\n);...Ch. 2 - int a, x = 23; a = x % 2; System.out.println(x +...Ch. 2 - Find the Error There are a number of syntax errors...Ch. 2 - Show how the double variables temp, weight, and...Ch. 2 - Prob. 2AWCh. 2 - Write assignment statements that perform the...Ch. 2 - Assume the variables result, w, x, y, and z are...Ch. 2 - Prob. 5AWCh. 2 - Modify the following program so it prints two...Ch. 2 - What will the following code output? int apples =...Ch. 2 - What will the following code output? double d =...Ch. 2 - What will the following code output? String...Ch. 2 - What will the following code output? String...Ch. 2 - Convert the following pseudocode to Java code. Be...Ch. 2 - Prob. 12AWCh. 2 - Write the code to set up all the necessary objects...Ch. 2 - Prob. 14AWCh. 2 - A program has a float variable named total and a...Ch. 2 - Is the following comment a single-line style...Ch. 2 - Is the following comment a single-line style...Ch. 2 - Describe what the phrase self-documenting program...Ch. 2 - Prob. 4SACh. 2 - Prob. 5SACh. 2 - Prob. 6SACh. 2 - Prob. 7SACh. 2 - Prob. 8SACh. 2 - Briefly describe the difference between variable...Ch. 2 - What is the difference between comments that start...Ch. 2 - Briefly describe what programming style means. Why...Ch. 2 - Assume that a program uses the named constant PI...Ch. 2 - Assume the file Sales Average, java is a Java...Ch. 2 - Prob. 14SACh. 2 - Name, Age, and Annual Income Write a program that...Ch. 2 - Name and Initials Write a program that has the...Ch. 2 - Personal Information Write a program that displays...Ch. 2 - Star Pattern Write a program that displays the...Ch. 2 - Sales Prediction The East Coast sales division of...Ch. 2 - Land Calculation One acre of land is equivalent to...Ch. 2 - Sales Tax Write a program that will ask the user...Ch. 2 - Cookie Calories A bag of cookies holds 40 cookies....Ch. 2 - Miles-per-Gallon A cars miles-per-gallon (MPG) can...Ch. 2 - Test Average Write a program that asks the user to...Ch. 2 - Circuit Board Profit An electronics company sells...Ch. 2 - Prob. 12PCCh. 2 - Restaurant Bill Write a program that computes the...Ch. 2 - Male and Female Percentages Write a program that...Ch. 2 - Stock Commission Kathryn bought 600 shares of...Ch. 2 - Energy Drink Consumption A soft drink company...Ch. 2 - Ingredient Adjuster A cookie recipe calls for the...Ch. 2 - Word Game Write a program that plays a word game...Ch. 2 - Stock Transaction Program Last month Joe purchased...Ch. 2 - Planting Grapevines A vineyard owner is planting...Ch. 2 - Compound Interest When a bank account pays...
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
- (Physics) Coulomb’s Law states that the force, F, acting between two electrically charged spheres is given by this formula: F=kq1q2r2 q1isthechargeonthefirstsphere.q2isthechargeonthesecondsphere.risthedistancebetweenthecentersofthetwospheres.kisaproportionalityconstant. Write an assignment statement to calculate the force, F.arrow_forwardTHIS SHOULD BE WRITTEN IN VISUAL C# FORMS: Create an application that lets the user know how many Pounds he/she will have when they get to England based on the number of dollars they have now. Also do the reverse. Calculate how many Dollars they will have when they return based on the number of Pounds they have when in England. Do the same for travelers going to Europe. Convert Dollars to Euro and Euro to Dollars. Program should allow you to enter the customer name, destination, money converted from and money converted to. After each customer transaction the name, destination, and both money amounts should be stored on a history file. Because the exchange rate changes daily you want a system that will easily adapt to the change. Your program needs to read text file (notepad) that will contain the conversion rates. That way each morning when you get to work you can put the new rates in the text file. Your program will read the text file as soon as you turn it on (Form_Load) and…arrow_forwardObject-Orineted Programming [Using Java Language] ==================================== Question - 6arrow_forward
- TOPICS: Data and Expressions MUST BE IN JAVA. PLEASE USE COMMENTS AND WRITE THE CODE IN SIMPLEST FORM. Write an application that prompts for and reads the numerator and denominator of a fraction as integers, then displays the decimal equivalent of the fraction. Hint: This requires casting from integer to double before dividing. Testing: Submit testing exhibits using the following inputs:0, 1 giving 0.0; 1, 2 giving 0.5; 3, 8 giving 0.375; 2, 3 giving 0.666...; 25, 7 giving 3.57128...arrow_forwardLanguage: JAVAarrow_forwardLook at the following pseudoocode and insert the missing statement: Start // Declare variables Declare String lastName, firstName, fullName // Input last and first names Display "Enter your last name: " Input lastName Display "Enter your first name: " Input firstName // Concatenate names with space in between ____ // Display full name Display "Your full name is " + fullName Stop JAVA PROGRAMMINGarrow_forward
- Code sniff for surearrow_forwardDIRECTIONS: Write the word TRUE if the statement is correct and if not, replace the underlined word(s) with the word(s) that will make the statement true. Example: Current that flows in a circuit can be limited using a transistor. Answer: transistor-resistor 1. Resistors can limit the flow of electric current. 2. Resistor is a passive device. 3. Capacitor can store electric charge. 4. Dielectric separates the two insulator sheets of a capacitor. 5. Passive device can be used as an amplifier.arrow_forwardName: Claz 4. Directions: The question or incomplete statement below is followed by four suggested answers or completions. Select the one that is best in each case. The code segment below is intended to display all multiples of 5 between the values start and end, inclusive. For example, if start has the value 35 and end has the value 50, the code segment should display the values 35, 40, 45, and 50. Assume that start and end are multiples of 5 and that start is less than end. Line 1: i + start Line 2: REPEAT TIMES Line 3: { DISPLAY (i)oplev a bonin vimobn ldemyA i + i + 5 Line 4: Line 5: Line 6: } Which of the following could replace in line 2 so that the code segment works as intended? wlf a0wollo 1 end - start + 1 b. end start + 6 (( end - start) / 5) + 1 d. 5 * (end - start) + 1 а. C.arrow_forward
- The Billy Goat Fast-Fast Food restaurant sells the following products: Product Price ($) Cheeseburger 2.49 Pepsi 1.00 Chips 0.59 Design the Python Program for an application that allows a user to enter an ordered item continuously until a sentinel value is entered. After each item, display its price or the message “Sorry, we do not carry that” as output. After all items have been entered, display the total prices for the order.arrow_forwardTrue or False 3. Variable names can have spaces in themarrow_forwardName Format - Use Javaarrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology PtrEBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTMicrosoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,
- Programming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage Learning
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning
.2: Function Parameters and Arguments - p5.js Tutorial; Author: The Coding Train;https://www.youtube.com/watch?v=zkc417YapfE;License: Standard Youtube License