Concept explainers
- 1. Read the problem statement.
- 2. Formulate the
algorithm using pseudocode and top-down, stepwise refinement. - 3. Write a Java
program . - 4. Test, debug and execute the Java program.
- 5. Process three complete sets of data.
(Credit Limit Calculator) Develop a Java application that determines whether any of several department-store customers has exceeded the credit limit on a charge account. For each customer, the following facts are available:
- 1. account number
- 2. balance at the beginning of the month
- 3. total of all items charged by the customer this month
- 4. total of all credits applied to the customer’s account this month
- 5. allowed credit limit.
The program should input all these facts as integers, calculate the new balance (= beginning balance + charges – credits), display the new balance and determine whether the new balance exceeds the customer’s credit limit. For those customers whose credit limit is exceeded, the program should display the message "Credit limit exceeded".
Want to see the full answer?
Check out a sample textbook solutionChapter 4 Solutions
Java How to Program, Early Objects (11th Edition) (Deitel: How to Program)
Additional Engineering Textbook Solutions
Starting Out with C++: Early Objects (9th Edition)
Computer Science: An Overview (13th Edition) (What's New in Computer Science)
Concepts Of Programming Languages
Database Concepts (8th Edition)
Management Information Systems: Managing The Digital Firm (16th Edition)
Starting Out with Java: From Control Structures through Objects (7th Edition) (What's New in Computer Science)
- (Thermodynamics) a. Design, write, compile, and run a program that determines the work,W, performed by a piston engine providing a force of 1000 N over a distance of 15 centimeters. The following formula is used to determine the work performed: W=Fd F is the force provided by the piston in Newtons. d is the distance the piston moves in meters. b. Manually check the values computed by your program. After verifying that your program is working correctly, modify it to determine the work performed by six pistons, each providing a force of 1500 N over a distance of 20 centimeters.arrow_forwardhope you get it fast for mearrow_forwardDon't put wrong code else downvotearrow_forward
- Java - Data Visualization (this is not graded)arrow_forwardneed help in java. (1) Prompt the user for a string that contains two strings separated by a comma. (1 pt) Examples of strings that can be accepted: Jill, Allen Jill , Allen Jill,Allen Ex: Enter input string: Jill, Allen (2) Report an error if the input string does not contain a comma. Continue to prompt until a valid string is entered. Note: If the input contains a comma, then assume that the input also contains two strings. (2 pts)Ex: Enter input string: Jill Allen Error: No comma in string. Enter input string: Jill, Allen (3) Extract the two words from the input string and remove any spaces. Store the strings in two separate variables and output the strings. (2 pts)Ex: Enter input string: Jill, Allen First word: Jill Second word: Allen provided code: import java.util.Scanner; public class ParseStrings { public static void main(String[] args) { Scanner scnr = new Scanner(System.in); /* Type your code here. */ }} (4) Using a loop, extend the program to handle…arrow_forwardLanguage: JAVAarrow_forward
- Q1: Can you read this question carefully rebug and type the answers Debug Problem 1: As an intern for The Weather Channel, you have been instructed to debug a java program that converts Celsius to Fahrenheit. If the formula runs correctly, then 12 degrees in Celsius should give 54 degrees in Fahrenheit . Here is the formula given and it might not be correctly stated in terms of () needed and the order of operations. Google a reputable site if needed.: °F = °C x 9/5 + 32 Remember that there may be more than one problem to fix. It could be that variables have an incorrect data type. It could be that the formula is not coded correctly. Also, some import statements could be missing. Copy and paste the code below in JGrasp and debug the code. Here is the code to debug: // Convert Celsius to Fahrenheit class CelsiusToFahr { public static void main (String args[]) { Scanner keyboard = new Scanner(System.in); int celsius = 0; int fahr = 0; System.out.println("Input the degrees in…arrow_forwardDEADLOCK MANAGEMENT TECHNIQUE Write a program to simulate the Banker’s algorithm for the purpose of deadlock avoidance. Your program receives as input the number of processes in the systems and how many devices each job requires to complete execution. Your program shows how devices are allocated to each process as it executes and if the system is currently in a safe or unsafe state. USE JAVAarrow_forwardbasic java code, self-learner here so pls do use more // comments ya if neededarrow_forward
- Explain how cleaning could be used to solve this problem Language used is Javaarrow_forwardObject-Oriented Programming ------------------------------------arrow_forwardList all correct answers where applicable. 1. Analyze the following code: boolean even = false; if (even = true) { System.out.println("It is even"); } a. The program has a compile error. b. The program has a runtime error. c. The program runs fine but displays nothing. d. The program runs fine and displays It is even. 2. Suppose x = 1, y = -1, and z = 1. What is the output of the following statement? if (x > 0) if (y > 0) System.out.println("x > 0 and y > 0"); else if (z > 0) System.out.println("x < 0 and z > 0"); a. x > 0 and y > 0; b. x < 0 and z > 0; c. x < 0 and z < 0; d. no output. 3. Suppose isPrime is a boolean variable, which of the following are correct for testing if isPrime is true. a. if (isPrime = true) b. if (isPrime == true) c. if (isPrime) d. if (!isPrime = false) e. if (!isPrime == false) 4. Which of the following are possible output from invoking Math.random()? a. 3.43 b. 0.5 c. 0.0 d. 1.0 5. Suppose you write…arrow_forward
- C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology Ptr