Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

can i get the proper code plz 2.31LAB : Convert to dollars Given four values representing counts of quarters, dimes, nickels and pennies, output the

can i get the proper code plz image text in transcribed
image text in transcribed
image text in transcribed
2.31LAB : Convert to dollars Given four values representing counts of quarters, dimes, nickels and pennies, output the total amount as dollars and cents. Output each floating-point value with two digits after the decimal point, which can be achieved as follows: System. out. printf("Anount: $5.2f(nn, dollars); Ex. If the inputis. 4321 Where 4 is the number of quarters, 3 is the number of dmes. 2 is the number of nickels, and 1 is the number of pennies, the output is: Anount: 11.41 For simpicity, assume inout is non-negative LabProgram.java Laod sefaul template. Bincluoe istolio.h int ealn() [. int quarters, dimes, nickels, dennies? scanf("Wd", liquarters): scanf ( 2.di, (laines)): scanf(7ud, Boackels): scanf( ( 44, Eotrinies): double gollars = cents / 1e0.e; printf("Aoount it the.21f)h", dorlars)? reburn of Run your program as often as you'd like, before submitting for grading. Below, type any n input values in the first box, then click Run program and observe the program's output in second box. Enter program input (optional) 4321 input(fromabove) What is this? 130MO0,0,0,00,0min:4 Latest submission - 9:08 PM CST on 01/30/23 Total Download this Failed to compile LabProgram.java:1: error: 11 legal character: 'I' Hinclude stdio, h LabProgram.java:1: error: claas, interface, or enum expected Finclude atdio.h> LabProgram.java:5: error: class, interface, or enum expected scanf ("\$d", squartera); LabProgram.java:6: error: class, interface, or enum expected scanf ("ta", sdimes) : Labprogram.java:7: error: claas, interface, ox enum expected seant(" a", tnickela): LabProgram,java;8: error: class, interface, of enum expected acane("td", ipenniea); Labprogram, jaya:10: error: a1oas, interface, of enum expected int cents = quartera*25 + dines*10 + niokele*5 + pennies: Labprogram.jaya:11: error: clazs, ipcerface, or enum expected double do1lare - centa 1100.0% Labprogaam,jova:12: exroz; elaas, interface, of enum expected Habprogran, jovazias erfor: olaas, intertace, or enua expected Feriurn of Hebfrograni.javaiya: exfor: clasa, intertace, ov enum expected

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

Step: 3

blur-text-image

Ace Your Homework with AI

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

Get Started

Recommended Textbook for

Oracle Solaris 11.2 System Administration (oracle Press)

Authors: Harry Foxwell

1st Edition

007184421X, 9780071844215

More Books

Students also viewed these Databases questions

Question

6. Explain how to train managers to coach employees.

Answered: 1 week ago

Question

5. Tell how job experiences can be used for skill development.

Answered: 1 week ago

Question

4. Explain the characteristics of successful mentoring programs.

Answered: 1 week ago