1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
lorasvet [3.4K]
3 years ago
10

Given four values representing counts of quarters, dimes, nickels and pennies, output the total amount as dollars and cents. Out

put each floating-point value with two digits after the decimal point, which can be achieved as follows: System.out.printf("Amount: $%.2f\n", dollars); Ex: If the input is: 4 3 2 1 where 4 is the number of quarters, 3 is the number of dimes, 2 is the number of nickels, and 1 is the number of pennies, the output is: Amount: $1.41 For simplicity, assume input is non-negative.
LAB ACTIVITY 2.32.1: LAB: Convert to dollars 0/10 LabProgram.java Load default template. 1 import java.util.Scanner; 2 3 public class LabProgram 4 public static void main(String[] args) { 5 Scanner scnr = new Scanner(System.in); 6 7 /* Type your code here. */|| 8 9) Develop mode Submit mode Run your program as often as you'd like, before submitting for grading. Below, type any needed input values in the first box, then click Run program and observe the program's output in the second box Enter program input (optional) If your code requires input values, provide them here. Run program Input (from above) 1 LabProgram.java (Your program) Output (shown below) Program output displayed here
Computers and Technology
1 answer:
vesna_86 [32]3 years ago
6 0

Answer:

Replace /* Type your code here. */ with the following lines of code

int quarter =scnr.nextInt();

int dime = scnr.nextInt();

int nickel = scnr.nextInt();

int penny = scnr.nextInt();

double dollars = quarter * 0.25 + dime * 0.1 + nickel * 0.05 + penny * 0.01;

System.out.printf("Amount: $%.2f\n", dollars);

System.out.print((dollars * 100)+" cents");

Explanation:

The next four lines declare the given currencies as integer

<em>int quarter =scnr.nextInt();</em>

<em>int dime = scnr.nextInt();</em>

<em>int nickel = scnr.nextInt();</em>

<em>int penny = scnr.nextInt();</em>

This line calculates the amount in dollars

<em>double dollars = quarter * 0.25 + dime * 0.1 + nickel * 0.05 + penny * 0.01;</em>

The next two lines print the amount in dollars and cents respectively

<em>System.out.printf("Amount: $%.2f\n", dollars); </em>

<em>System.out.print((dollars * 100)+" cents");</em>

You might be interested in
You will be administratively suspended if you have a breath or blood alcohol level of.... or above or refuse to submit to a chem
Andrej [43]
0.04% is the legal limit for commercial drivers.
8 0
4 years ago
You are querying a database of manufacturing company suppliers. The column name for supplier identification numbers is supplier_
irina1246 [14]

Queries are used to retrieve data from the database

The correct clause to retrieve only data about the supplier with identification number 85317 is WHERE supplier_id = 85317

<h3>How to determine the query</h3>

The clause is given as:

identification number = 85317

To retrieve data from the database, we make use of the WHERE clause followed by the column name, and the column value

In this case,

supplier_id represents the column name, while 85317 represents the value

Hence, the required clause is

WHERE supplier_id = 85317

Read more about database at:

brainly.com/question/1538272

8 0
2 years ago
Frank accidently overwrote his old document with a new document of the same name. He'd like to get his old document back. What f
Archy [21]

Answer:

the recycle bin?

Explanation:

usually when you overwrite something or delete it, it doesn't get entirely deleted rather stored in the recycle bin on your desktop i believe, and so you could retrieve applications through there

4 0
3 years ago
Which of the following is NOT a recommended characteristic for incident objectives?A. Stated in broad terms to allow for flexibi
docker41 [41]

Answer:

A. Stated in broad terms to allow for flexibility.

Explanation:

Incident command are controls or directives needed in production or in an organization. A few characteristics not incident command objectives are, all projects and targets must be measurable and attainable, aii hand on board must function in accordance with the incident commander's authorities, and every finished project must meet company quality standards and deadlines. The incident commander's authorities are fixed for a particular sector and is rigid.

6 0
3 years ago
Which event represents an example of social media being used in an
Semmy [17]
Hello!

The answer is:
-D. Communication with friends and family after other systems were disabled by a major earthquake.

I hope this helps you! :)
7 0
2 years ago
Other questions:
  • Fibre channel switched networks rely on the concept of a ___________________which is a fundamental concept in how the network wo
    10·1 answer
  • Which activity constitutes legal computer activity?
    12·1 answer
  • You have connected thirteen pcs and laptops to a wireless network. to make your wlan more secure, what should you do to disallow
    11·1 answer
  • In python:
    14·1 answer
  • The OSI is a reference system that is used by most types of technicians EXCEPT _____.
    11·2 answers
  • What does a capitalist economy allow people to do?
    11·2 answers
  • HELP WILL GIVE BRAINLIEST
    5·1 answer
  • What is the safest way to pay online​
    13·2 answers
  • Overview In this assignment, you will gain more practice with designing a program. Specifically, you will create pseudocode for
    7·1 answer
  • A trial-and-error method of problem solving used when an algorithmic or mathematical approach is called
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!