Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please help below is my code for this project and it compiles and runs but i keep getting an error that says: [ERROR] ATM.java:77 (Line

Please help below is my code for this project and it compiles and runs but i keep getting an error that says: [ERROR] ATM.java:77 (Line 77 of the program esle part of statement): 'else' construct must use '{}'s. [NeedBraces] The only problem is without the else part of the project it still runs but automatically shows the amount of "300 exceeded". Also below the code is a picture of the assignment and how the ouput of the program should look exactly.

1 /** 2 *Program to create an ATM 3 * 4 */ 5 import java.util.Scanner; 6 /** 7 *Program lets user enter amount in whole dollars. 8 *Number of bills to be dispensed by denomination. 9 *Limit of 300 dollars must not be exceeded. 10 *Uses a scanner imported from the java library. 11 * 12 *@author Julian Woods 13 *@version January 26, 2018 14 */ 15 public class ATM 16 { 17 /** 18 *Prints the amount of bills to std output. 19 *Also prints calculations for the program. 20 * 21 *@param args Command line arguments (not used). 22 */ 23 public static void main(String[] args) 24 { 25 //Scanner for user to read in 26 Scanner sc = new Scanner(System.in); 27 System.out.println("Enter the Amount:\t"); 28 int amt = sc.nextInt(); 29 int amtstore = amt; 30 if (amt

image text in transcribed

ATM.java Requirements: An ATM manufacturer would like a program that allows the user to enter the amount of cash in whole dollars and then displays the number bills by denomination be dispensed if the limit of $300 is not exceeded. Design: The ATM manufacturer would like the output to look as shown below when 400 is entered as the amount for one run and 279 is entered for another run. Line number Program output Enter the amount: 400 2 Limit of $300 exceeded! Line number Program output Enter the amount: 279 Bills by denomination: $20: 13 $10: 1 4 $5:1 $1: 4 $279-(13$20) (1 $10) (1 $5) (4$1) 7 Your program must follow the above format with respect to the output. Note that lines 3 through 6 for the amount 279 begin with tab, which is set to three spaces in jGRASP(i.e. your output should use the escape sequence for a tab)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions