JAVA PROGRAM(LL)+MINDTAP (1 TERM) V2.0
9th Edition
ISBN: 9780357616673
Author: FARRELL
Publisher: CENGAGE L
expand_more
expand_more
format_list_bulleted
Concept explainers
Expert Solution & Answer
Chapter 5, Problem 16RQ
Program Description Answer
The statement that displays the string “Error”, when a student ID is less than “1000” or more than “9999” is as follows,
//Check whether student ID is less than "1000"
if(stuId < 1000)
//Print the string "Error"
System.out.println("Error");
//Otherwise
else
//Check whether the student ID is greater than "9999"
if(stuId > 9999)
//Print the string "9999"
System.out.println("Error");
Hence, correct answer is option “C”.
Expert Solution & Answer
Trending nowThis is a popular solution!
Students have asked these similar questions
please send step by step complete handwritten solution for Q7
An ISBN (International Standard Book Number) is a 10 digit number that is used to identify a book. The first nine digits of the ISBN number are used to represent the Title, Publisher and Group of the book and the last digit is used for
checking whether ISBN is correct or not. To uniquely identify a book a 10-digit ISBN number is used. The rightmost digit is checksum digit. This digit is determined from the other 9 digits using condition that 10d, + 9dz + 8dg + + d4o
must be a multiple of 11 (where d, denotes the i" digit from the right). The checksum digit d; can be any value from 0 to 10: the ISBN convention is to use the value X to denote 10. Write a C program using pointers that receives a 10-
digit ISBN, and computes the checksum, and reports whether the ISBN number is correct or not.
Example: 007462542X = 10°0 + 9*0 + 8*7 + 74 + 6*6 + 5*2 + 4*5 + 3"4 + 2*2 + 110 = 176
Since 176 leaves no remainder when divided by 11, hence it is a valid ISBN.
Note: When the check digit turns out…
Compute the income tax due on taxable income entered by the user, given the data as
shown in the following table. Be sure to include error checking to make sure the user
does not enter a negative number. Assume all entries are integer values.
Taxable Income
Tax Due
From
To
$0
$49,999
$0 + 5% of amount over $0
$50,000
$99,999
$2,500 +7% of amount over $50,000
$100,000
$6,000 + 9% of amount over $100,000
(Provide the following: Pseudocode; Flowchart)
Dago 2 of 5
Chapter 5 Solutions
JAVA PROGRAM(LL)+MINDTAP (1 TERM) V2.0
Ch. 5 - Prob. 1RQCh. 5 - Prob. 2RQCh. 5 - Prob. 3RQCh. 5 - Prob. 4RQCh. 5 - Prob. 5RQCh. 5 - Prob. 6RQCh. 5 - Prob. 7RQCh. 5 - Prob. 8RQCh. 5 - Prob. 9RQCh. 5 - Prob. 10RQ
Ch. 5 - Prob. 11RQCh. 5 - Prob. 12RQCh. 5 - Prob. 13RQCh. 5 - Prob. 14RQCh. 5 - Prob. 16RQCh. 5 - Prob. 17RQCh. 5 - Prob. 18RQCh. 5 - Prob. 19RQCh. 5 - Prob. 20RQCh. 5 - Prob. 1PECh. 5 - Prob. 2PECh. 5 - Prob. 3PECh. 5 - Prob. 4PECh. 5 - Prob. 5PECh. 5 - Prob. 6PECh. 5 - Prob. 7PECh. 5 - Prob. 8PECh. 5 - Prob. 9PECh. 5 - Prob. 10PECh. 5 - Prob. 1GZCh. 5 - Prob. 2GZCh. 5 - Prob. 3GZCh. 5 - Prob. 4GZCh. 5 - Prob. 5GZ
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
- On F |||| Please enter your choice: 1 1232 12343 |||| 1. View all students' records 2. View a student's records by ID 2343 3423 7. Complete the following problem below in java The program will first display a menu that enables the users to choose whether they want to view all students 'records or view only the records of a specific student by the student's id. See sample below. Example: 11232 Paragraph If the user types in for Choice 1, it displays this: StudentID | Quiz1 | Quiz2 | Mid-Term | Final | | 10 | 23 145 | 56 | | 45 | 43 | 78 | | 34 | 45 | 45 | | 67 | 6 | 56 1 Code: MENU Accessibility: Unavailable Q Search < | 24 | 45 | 65 If the user types in for Choice 2, it will ask the user to enter in an ID. If the user enters in an invalid ID, the user has to keep entering one in until a correct one is entered. Once a valid ID is entered, will display the students ID, Quiz1, Quiz2, Mid-Term, and Final grade. | 10 | 23 r √5 | 45 | 56 C 18 1 Styles O Normaarrow_forwardis an operator which can be used for checking if two values are the same.arrow_forwardProgramming Language: Java Direction: Write a program to determine the number of PASSED and FAILED out of 15 inputted names with the corresponding grade. Restrict the inputted grade for each name in the range of 50 to 100, in which 75 is the passing grade. If the inputted grade is not on the range, the program will remind the user of a message for the accepted range for the grade and allows the user to re-enter a grade. NOTE: MUST ADD COMMENTSarrow_forward
- PROBLEM: When creating account: It should be 6 digit pin. (if there is a letter or not 6 digits were put in, output will say "Please retry. It should be a 6 digit pin."). It should also have an authenticator for the pin and if the inputted pin is wrong show "Invalid Pin. Please try again." and if it is still wrong in 3 tries, it'll say "Too many incorrect tries. Exiting program." CODE: import random import sys class ATM(): def __init__(customer, name, account_number, balance = 0): customer.name = name customer.account_number = account_number customer.balance = balance def account_detail(customer): print("\n-ACCOUNT DETAIL-") print(f"Account Holder: {customer.name.upper()}") print(f"Account Number: {customer.account_number}") print(f"Available balance: Nu.{customer.balance}\n") def deposit(customer, amount): customer.amount = amount customer.balance = customer.balance +…arrow_forwardint num1 = 10, num2 = 9, num3 = 18; num1arrow_forwardWrite a Case clause that specifies all numbers less than 0.arrow_forwardThe company discounted used cars pays their employees according to this chart: 250$ per months plus 50$ per car sold. If the salesman sells more than 10 cars, the employee receives a bonus of 5% of the total of his sales, in addition to his regular salary.Each month, the owner sits in front of the computer, and enters the following information: The name of the employee, the number of cars sold, as well as the total of all the sales for the month. algorithm that will calculate the salary of an employee for the month, and then display on the screen, his name, total cars sold, base salary, bonus if applicable and entire salaryarrow_forwardAssignment details: Replace all the 0 (Zero) digits in your ID by 4. Example: If your ID is 38104680, it becomes 38144684 Take the first 6 digits and substitute them in this expression (( A + B) / C) * ((D-E)/F)-2) according to the following table; Letter Replace by Digit Example Digit A 1st 3 B 2nd 8 C 3rd 1 D 4th 4 E 5th 4 F 6th 6 After substitution your expression will be similar to this (( 3 + 8) / 1) * ((4-4)/6)-2). Draw a rooted tree that represents your expression. [3 marks] What is the prefix form of this expression. What is the value of the prefix expression obtained in step 2 above?arrow_forwardCreate an application that finds the greatest common divisor of two positive integers entered by the user. Console Greatest Common Divisor Finder Enter first number: 12 Enter second number: 8 Greatest common divisor: 4 Continue? (y/n): y Enter first number: 77 Enter second number: 33 Greatest common divisor: 11 Continue? (y/n): y Enter first number: 441 Enter second number: 252 Greatest common divisor: 63 Continue? (y/n): n Specifications The formula for finding the greatest common divisor of two positive integers x and y must follow the Euclidean algorithm as follows: Subtract x from y repeatedly until y < x. Swap the values of x and y. Repeat steps 1 and 2 until x = 0. y is the greatest common divisor of the two numbers. You can use one loop for step 1 of the algorithm nested within a second loop for step 3. Assume that the user will enter valid integers for both numbers. The application should continue only if the user enters 'y' or 'Y' to continue. Note that if you do…arrow_forwardFor the code below can you varify the card number, card exp date, card cvv and address for example the card number should be 13 numbers if any more it should say "invalid" for the card exp date it should be like 12/35 if not then its invalid for card cvv it should only be 3 numbers and address should be like 11-11-11st as long as it has the "-" and "st" also when ever its invalid can you make it print on the bottom of the box like the example in the image below. thank you <!DOCTYPE html> <html> <head> <style> input { height: 25px; border-radius: 5px; } </style> <script> function validate() { if (!validateVal(document.getElementById("number").value)) { alert("Please Enter the number"); return; } var num = parseInt(document.getElementById("number").value); if (num < 1 || num > 9) { alert("Enter a number between 1 and 9(Including 1 and 9)"); return; } if (!validateVal(document.getElementById("name").value)) {…arrow_forwardElection Commission of Malaysia (SPR) wants to develop a registration of voter's program. To register as an elector, one must be a Malaysian citizen and be 21 years old and above. Firstly, the user need to key in IC number. If the IC number is not valid, the system will print "IC number is not valid" and quit from the system. If the IC number is valid, the system will then check the age of voters based on the year of birth from the IC number. If the age is 21 and above, the program will print a status as "Qualified". If not, the program will print "Disqualified". Q1arrow_forwardBased on the case above, clearly define the following item : Dataarrow_forwardarrow_back_iosSEE MORE QUESTIONSarrow_forward_ios
Recommended textbooks for you
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTNp Ms Office 365/Excel 2016 I NtermedComputer ScienceISBN:9781337508841Author:CareyPublisher:CengageProgramming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage Learning
- Programming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:Cengage
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:9781337508841
Author:Carey
Publisher:Cengage
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Linux - Tutorial for Beginners in 13 MINUTES! [ UPDATED ]; Author: bai;https://www.youtube.com/watch?v=BMGixkvJ-6w;License: Standard YouTube License, CC-BY
What is Linux?; Author: Techquickie;https://www.youtube.com/watch?v=zA3vmx0GaO8;License: Standard YouTube License, CC-BY
Introduction to Linux and Basic Linux Commands for Beginners; Author: sakitech;https://www.youtube.com/watch?v=IVquJh3DXUA;License: Standard Youtube License