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
QUESTION 7 of 20: What is it called when different seats are priced differently?
never [62]
Yield management pricing.
6 0
3 years ago
2. Intranets and Extranets
ANTONII [103]

The difference between intranets and extranets is that intranet is a network within an organization while extranet can provide controlled access to authorized customers outside the organization.

The World Wide Web serves as a system that consists different system which have public webpages.

The  types of authentication can be:

  • what you know such as personal identification number
  • what you have such as card
  • what you are such as  biometrics

<h3>What are intranets and extranets ?</h3>

intranets and extranets are both network, where the first is been used within the organization and the later outside with a permissible access.

learn more aboutintranets and extranets  at :brainly.com/question/13742795

#SPJ1

8 0
2 years ago
Who here watches obx, Riverdale or on my block?
melomori [17]

Answer:

Riverdale i watch it!

Explanation:

3 0
3 years ago
Read 2 more answers
HELP ASAP!!!
kvv77 [185]
It's both about mixing colors and the effect those colors can have, so I'd go with true.
8 0
4 years ago
Read 2 more answers
Computers infected by a virus, worm, or Trojan horse that allows them to be remotely controlled for malicious purposes are calle
yuradex [85]

Blaster Worm., the worm has been designed to tunnel into your system and allow malicious users to control your computer remotely. A Trojan horse is not a virus. It is a destructive program that looks as a genuine application. Unlike viruses, Trojan horses do not replicate themselves but they can be just as destructive.

4 0
3 years ago
Other questions:
  • PLEASE HELP!!!!!!!!!!!!!!!!!!!!!
    11·2 answers
  • Which is the 6-by6 rule for presentations
    11·1 answer
  • Explain how applying different network topologies could have an impact on the security of a network
    11·1 answer
  • Complete the following statements by choosing the correct answer from the drop-down menus.
    14·1 answer
  • A/an ________is a device used to protect computers against surges and spikes in power.
    14·1 answer
  • What are the three aspects to consider when taking and critiquing photograph?
    9·1 answer
  • Cash cows are always in
    7·1 answer
  • You would like to narrow your search on this topic.
    15·2 answers
  • Which is one of the modes of game advertising?
    13·2 answers
  • Can yall help me pls
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!