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
Mintzberg's classification of organizational structure categorizes the knowledge-based organization where goods and services dep
sineoko [7]

Answer:

The correct answer to the following question will be Option 3 (Professional bureaucracy).

Explanation:

  • Professional bureaucracy is evidence that uncentralized organizations can be administrative. Their organizational function is reliable, culminating in "preconceived or repetitive actions, in essence, uniform."It's also very complicated, and so the operators who are doing it should be regulated.
  • Mintzberg's organizational framework categorization classifies the information-based organization where services and goods depend as a highly qualified bureaucracy on both the knowledge and expertise of experts.

The other alternatives are not related to the structure of the Mintzberg. So choice 3 is the correct answer.

8 0
4 years ago
This speaker could be an instructor, a politician on the television, or even a radio or television commercial. What barriers wer
Shkiper50 [21]

Answer:

Electromagnetic interference and noise from the transmitting or receiving device.

Explanation:

Communication involves four processes, they are; encoding, sending, decoding, and feedback. A message, during this process of communication, can be altered, this is known as noise.

Telecommunication is simply communication between long distances. The effect of noise is more pronounced and can be noticed by listeners. These noises are produced by the transmitter and electromagnetic signals or waves of other transmitting devices.

6 0
3 years ago
Provide a brief, high-level description of how the Internet’s connection-oriented service provides reliable transport.
mario62 [17]

Answer:

  Connection-oriented is the method which is implemented in the transport and data link layer. It is basically depend upon the physical connection in the network system.

Transmission control protocol (TCP) is the connection oriented and user datagram protocol (UDP) is the connection less network transport layer. The TCP and UDP both are operate in the internet protocol (IP).

It basically require connection and it can be establish before sending data. This is also known as reliable network connection service. The connection oriented service establish connection between the different connection terminal before sending any data or information. It can easily handle traffic efficiently.

7 0
3 years ago
Given a string, an integer position, and an integer length, all on separate lines, output the substring from that position of th
lana [24]

quetma es elpx mjeghgieo

4 0
3 years ago
Read the code below.
Rasek [7]

Answer:

theres an error on line one used python idle

Explanation:

8 0
4 years ago
Other questions:
  • Write a function named delete Letter that has 2 parameters. The first parameter is a string, the second parameter is an integer.
    11·1 answer
  • What does the following code do? Assume list is an array of int values, temp is some previously initialized int value, and c is
    15·2 answers
  • What component of Kerberos is responsible for storing keys for encrypting and decrypting data in the authentication process?
    13·1 answer
  • You would like to enter a formula that subtracts the data in cell B4 from the total of cells B2 and B3. What should the formula
    10·1 answer
  • Which of the following statements is true?
    13·1 answer
  • Janet received an email from a bank asking for the password for her Internet banking account. She emailed back her password. A f
    12·2 answers
  • The best way to safeguard your document is to save it
    11·1 answer
  • What finger should be on the Y key?
    12·2 answers
  • An important goal of biosecurity training is to: Prevent laboratory accidents that could expose personnel to hazardous agents. P
    13·1 answer
  • Write a program to find the product of 3 numbers
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!