Absolute Java (6th Edition)
6th Edition
ISBN: 9780134041674
Author: Walter Savitch, Kenrick Mock
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Concept explainers
Textbook Question
Chapter 3, Problem 14STE
Suppose
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Write a flowchart and pseudocode like this:
Pseudocode:
Start
inputmyNumber
Set myAnswer-myNumber * 10
output myAnswer
1.The Dash Cell Phone Company charges customers a basic rate of $5 per month to send text messages. Additional rates are as follows:
The first 100 messages per month, regardless of message length, are included in the basic bill.
An additional three cents are charged for each text message after the 100th message, up to and including 300 messages.
An additional two cents are charged for each text message after the 300th message.
Federal, state, and local taxes add a total of 14 percent to each bill.
THANKYOUU
An argument is expressed in English below.
Sara is not excited.
If Sara is not excited, then Sara will go to the party.
Sara is sleepy.
4
: Sara will go to the party and Sara is sleepy.
Variable names are assigned to each English phrase as follows:
• q: Sara is excited
•r: Sara will go to the party
• : Sara is sleepy
What is the form of the argument?
Pick
Pick v
.: Pick
2
Check
Next
user_num1 and user_num2 are read from input.
If user_num1 is less than 0, output 'user_num1 is negative'.
If user_num2 is greater than 8, assign user_num2 with 5.
Otherwise, output 'user_num2 is less than or equal to 8'.
Click here for examples
●
1 user_num1 = int(input())
int(input())
2 user_num2 =
3 |
4 user_num int (input)
5 user_num2
int (input 0)
6 if user_num1 8:
9 user_num2
=
user_num2-5
10 else:
11 print (user_num2 is less than or equal to 8')
12 print('user_num2 is', user_num2)
Chapter 3 Solutions
Absolute Java (6th Edition)
Ch. 3 - Write an if-else statement that outputs the word...Ch. 3 - Suppose savings and expenses are variables of type...Ch. 3 - Suppose number is a variable of type int. Write an...Ch. 3 - Suppose salary and deductions are variables of...Ch. 3 - What output will be produced by the following...Ch. 3 - What would be the output in Self-Test Exercise 5...Ch. 3 - What would be the output in Self-Test Exercise 5...Ch. 3 - Write a multiway if-else statement that classifies...Ch. 3 - Prob. 9STECh. 3 - Prob. 10STE
Ch. 3 - Prob. 11STECh. 3 - Prob. 12STECh. 3 - Prob. 13STECh. 3 - Suppose are two variables that have been given...Ch. 3 - Prob. 15STECh. 3 - Assume that nextword is a String variable that has...Ch. 3 - Write an if-else statement that outputs the word...Ch. 3 - Write an if-else statement that outputs the word...Ch. 3 - Determine the value, true or false, of each of the...Ch. 3 - Does the following sequence produce a division by...Ch. 3 - Prob. 21STECh. 3 - Prob. 22STECh. 3 - What output would be produced in Self-Test...Ch. 3 - What is the output produced by the following?
Ch. 3 - What output would be produced in Self-Test...Ch. 3 - Prob. 26STECh. 3 - What is the most important difference between a...Ch. 3 - Prob. 28STECh. 3 - Prob. 29STECh. 3 - What is the output of the following?
Ch. 3 - Rewrite the following for statement as a while...Ch. 3 - What is the output of the following loop? Identify...Ch. 3 - What is the output of the following loop? Comment...Ch. 3 - Prob. 34STECh. 3 - For each of the following situations, tell which...Ch. 3 - What is the output of the following?
Ch. 3 - What is the output of the following?
Ch. 3 - What is the output produced by the following?...Ch. 3 - What is the output produced by the following?...Ch. 3 - Fix the bug in the code in the earlier subsection...Ch. 3 - Add some suitable output statements to the...Ch. 3 - What is the bug in the following code? What do you...Ch. 3 - Prob. 43STECh. 3 - What numbers could be generated by...Ch. 3 - What numbers could be generated by...Ch. 3 - Use the method Math. random to generate a random...Ch. 3 - (This is a version of Programming Project 2.1 from...Ch. 3 - A designer is trying to create a new pattern of...Ch. 3 - Weight is defined as the gravitational force...Ch. 3 - It is difficult to make a budget that spans...Ch. 3 - You have just purchased a stereo system that cost ...Ch. 3 - The Fibonacci numbers Fn are defined as follows:...Ch. 3 - An Armstrong number is an n-digit number that...Ch. 3 - In a certain code language, numerals are each...Ch. 3 - Write a program that calculates the total grade...Ch. 3 - The game of Pig is a simple two-player dice game...Ch. 3 - You have three identical prizes to give away and a...Ch. 3 - Redo or do for the first time Programming Project...Ch. 3 - The file words. txt on the hook's website contains...Ch. 3 - The file words. txt on the book's website contains...Ch. 3 - This problem is based on a "Nifty Assignment" by...Ch. 3 - Prob. 16PP
Additional Engineering Textbook Solutions
Find more solutions based on key concepts
Write a program that finds the temperature that is the same in both Celsius and Fahrenheit. The formula to conv...
Problem Solving with C++ (9th Edition)
Define the term database.
Database Concepts (7th Edition)
Determine whether the following program segments contain errors. For each error, explain how to correct it. [No...
C How to Program (8th Edition)
Describe the difference between a key word and a programmer-defined symbol.
Starting Out with Java: From Control Structures through Objects (6th Edition)
Explain the different aspects of the cost of a programming language.
Concepts Of Programming Languages
Whats wrong with the following array declarations? int[] readings = new int[-1]; double[] measurements = new do...
Starting Out with Java: From Control Structures through Data Structures (3rd Edition)
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
- An instructor wants to give feedback to students in an assignment according to the number of correctly solved programs. Example of feedback :Nb of correct programs Feedback 0 incomplete assignment1 partially correct assignment2 Satisfactory attempt 3 Good attempt4 Excellent attemptThe following figure shows an example of execution.Write the Java program that reads the number of correctly solved programs and displays the adequate feedback.Note: Choose your own feedback message and do not copy from the previous table. Use any of the conditional statements like if-else/ if-else-if/switch case.arrow_forwardThe body mass index, BMI, is a measure used to determine if a person is overweight or not. We can calculate BMI from the weight of the person (in pounds) and the height (in inches) of the person.The formula for calculating BMI is:BMI = (weightInPounds * 703) divided by (heightInInches squared)In this problem, you will develop a Java program as a BMI calculator, that reads the user’s weight in pounds and height in inches, then calculates and displays the user’s body mass index BMI. Also, display the following information {from the US Department of Health} so the user can evaluate his/her BMI:BMI values:Underweight: less than 18.5Normal: between 18.5 and 24.9Overweight: between 25 and 29.9Obese: 30 or greaterarrow_forwardScenario As you surely know, due to some astronomical reasons, years may be leap or common. The former are 366 days long, while the latter are 365 days long. Since the introduction of the Gregorian calendar (in 1582), the following rule is used to determine the kind of year: if the year number isn't divisible by four, it's a common year, otherwise, if the year number isn't divisible by 100, it's a leap year. otherwise, if the year number isn't divisible by 400, it's a common year. otherwise, it's a leap year. none of the above year int(input("enter the year")) if (year%4 1-0) and (year%400 -0) or (year % 1000): print (year is common year") else: print(year, is leap year") year= int(input ("enter the year")) if (years !-0) or (year480 1-0) and (year % 1001-0): print(year is common year") else: print(year, "is leap year") D year= int(input("enter the year"))arrow_forward
- Asks for the hourly pay rate and hours worked for an employee and returns the employee's net pay for those hours. Each employee is paid 1.5 times their regular hourly rate for all hours over 40. A tax amount of 1 percent of gross salary is deducted. The program should keep going until you enter N. Finally display the total pay for all employees and its average. using java programmingarrow_forwardWhat is the output of the statements below? x=3 while xarrow_forwardConsider this code: "int s = 20; int t = s++ + --s;". What are the values of s and t? A. s is 19 and t is 38 B. s is 20 and t is 38 C. s is 20 and t cannot be determined D. s is 19 and t is 39 E. s is 20 and t is 39arrow_forward
- Use java code Body Mass Index (BMI) is a measure of health on weight. It can be calculated by taking your weight in kilograms and dividing by the square of your height in meters. The interpretation of BMI for people 16 years or older is as follows: BMI below 16 16-18 19-24 25-29 30-35 above 35 Interpretation seriously underweight underweight normal weight overweight seriously overweight gravely overweight Write a Java program that prompts the user to enter a weight in kilograms and height in meter and display the BMI. Use nested if- else statements to solve this exercise. Here is a sample run: Enter weight in kilograms: 66.22 Enter height in meters: 1.788 Your BMI is 20.71353142 You are normal weightarrow_forwardCorrect answer only. Code and output screenshot. Nastia has 2 positive integers An and B. She characterizes that: The integer is acceptable in case it is detachable by A⋅B; In any case, the integer is almost acceptable, in case it is detachable by A. For instance, if A=6 and B=4, the integers 24 and 72 are acceptable, the integers 6, 660 and 12 are almost acceptable, the integers 16, 7 are neither acceptable nor almost great. Discover 3 unique positive integers x, y, and z to such an extent that precisely one of them is acceptable and the other 2 are almost acceptable, and x+y=z. Input The main line contains a solitary integer t (1≤t≤10000) — the number of experiments. The primary line of each experiment contains two integers An and B (1≤A≤106, 1≤B≤106) — numbers that Nastia has. Output For each experiment print: "Indeed" and 3 distinct positive integers x, y, and z (1≤x,y,z≤1018) to such an extent that precisely one of them is acceptable and the other 2…arrow_forwardSuppose you deposit a certain amount of money into a savings account that earns compound monthly interest, and you want to calculate you will have after a specific amount number of months. The formula is: F = P * (1 + i)tWhere the terms in the formula are as follows: F is the future value of the account after the specified amount of time. P is the present value, or the amount that you want deposit. i is the monthly interest rate. t is the number of months that you plan to let the money sit in the account. JavaScript programs pleasearrow_forward
- 1a. It is known that x and n are integers, where x has a value of -1 and n has a value of 5. What is the valueof the following expression? !(++x || n) + 6 - (!n && n * (n < n)) I know this equals 6 but how do I work it out 1a .Compute the values of the following expressions if x is 1, y is 4 and z is 14. Assume thattrue relations have a value of 1 (I want to see how these problems are worked out) 1B. work out each of these. x+5<=z-(x||z)-y z/y%z-6<=!y x>=1&&y==3+y||z<14 x-!y-y<=z*z/6>yarrow_forwardNeed help coding in Java Morgan’s Department Store distributes bonuses to its salespeople after the holiday rush. Table 9-6 shows the bonuses, which are based on full weeks worked during the season and the number of positive online customer reviews. Write a program that allows a user to continuously enter values for the number of weeks worked and the number of positive reviews received and displays the appropriate bonus until the user enter a sentinel value: 99.arrow_forward7. Consider calculating the sum of all positive integers less or equal thann that are even and not multiples of 5. For example if n=15 the sum is 46 as it is the sum of 2+4+6+8+12+14. Write a while statement that calculates the expected sum. You can assume the variable n already exists with some positive integer value. Store the output in an unsigned long int variable named even_sum. You can declare and initialize additional variables as needed.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTC++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage Learning
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Control Structure in Data Structure - Data Structures - Computer Science Class 12; Author: Ekeeda;https://www.youtube.com/watch?v=9FTw2pXLhv4;License: Standard YouTube License, CC-BY