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
GrogVix [38]
3 years ago
12

"Using the printf method, print the values of the integer variables bottles and cans so that the output looks like this: Bottles

: 8 Cans: 24 The numbers to the right should line up. (You may assume that the numbers have at most 8 digits.)"
Computers and Technology
1 answer:
Anika [276]3 years ago
6 0

Answer:

import java.util.Scanner;

public class Main

{

public static void main(String[] args) {

       Scanner in = new Scanner(System.in);

       

       System.out.println("Enter the number of bottles and cans:");

       int numberOfbottles = in.nextInt();

       int numberOfcans = in.nextInt();

       System.out.printf("Bottles: %8d\n", numberOfbottles);

       System.out.printf("Cans:    %8d\n", numberOfcans);

}

}

Explanation:

Ask user to input the number of bottles and cans using Scanner class

Print the results so that the numbers to the right line up (Since we know that the numbers have at most 8 digits, we can use %8d in printf. Also, be aware that how printf statements are written so that the numbers line up)

You might be interested in
Assignment 3: chabot<br>​
Goryan [66]

Answer:

question?

Explanation:

6 0
2 years ago
What is the cell reference for row 22 and column B? __________<br><br> In excel
vovikov84 [41]
The cell reference is B22

plz thank me, it keeps me motivated to answer more of your questions :)
8 0
3 years ago
The Cisco IOS automatically modifies the dead interval when the _____ interval is changed. (Points : 2) hello
erma4kov [3.2K]

Answer: MD5

Explanation:

 The Cisco IOS modifying the dead internal automatically when the message digest 5 (MD5) internal are changed in the system. When we enabled the MD5 authentication in the Cisco by using the keyword "Message digest" then we configuring the password in the IP OSPF interface command which is known as MD5 key.

The OSPF interface is a compatible configuration in the remote interface before they considered as neighbors in the Cisco system. The MD5 are basically created by the cisco NX-OS.

5 0
3 years ago
Can y’all help me with these questions ?
andriy [413]
45. Nic card
46. Word processing
7 0
3 years ago
Question 1 (1 point)
S_A_V [24]

Answer:

I'm not 100% on the answers . . .

Explanation:

1. A, 2. C, 3. D, 4. A, 5. D, 6. A & B, 7. False, 8. D, 9. D, 10. D

7 0
2 years ago
Read 2 more answers
Other questions:
  • Your friend sees an error message during Windows startup about a corrupted bootmgr file. He has another computer with a matching
    12·1 answer
  • list six external parts or peripherals of a computer system and identify which are output and which are input devices
    8·1 answer
  • What is a good way to minimize technical problems with your computer
    10·1 answer
  • What are attribute grammars used for?
    8·1 answer
  • Different between desktop application and web application ?​
    9·1 answer
  • _____________are where you get down to business and enter data in a worksheet
    12·1 answer
  • GIVING OUT BRAINLIEST AND I AM ALSO WARNING EVERYONE TO NOT ANSWER A BUNCH OF rubbish just to get the points!
    7·2 answers
  • When dividing it’s total debt by total equity what’s a company trying to measure
    9·1 answer
  • Which tools can help you gather information about the processes running on a windows operating system?
    12·2 answers
  • Suppose your team is finishing a project and the supervisor stresses ensuring the material cannot be erased. To what memory leve
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!