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
iVinArrow [24]
3 years ago
11

Write a program that uses a while loop to calculate and print the multiples of 3 from 3 to 21. Your program should print each nu

mber on a separate line. Expected Output:
3
6
9
12
15
18
21
Computers and Technology
1 answer:
nexus9112 [7]3 years ago
6 0

Code:

num = 3

while num <= 21:

   print(num)

   num+=3

Output of code:

3

6

9

12

15

18

21

Explanation:

The condition num <= 21 will ensure that the program will only print multiples of 3 up to 21. We set num as 3 since we want to start printing from 3, and we add 3 each time to get the multiples.

Hope this helps :)

You might be interested in
g Create your own data file consisting of integer, double or String values. Create your own unique Java application to read all
Jlenok [28]

Answer:

See explaination

Explanation:

//ReadFile.java

import java.io.File;

import java.io.FileNotFoundException;

import java.util.Scanner;

public class ReadFile

{

public static void main(String[] args)

{

int elementsCount=0;

//Create a File class object

File file=null;

Scanner fileScanner=null;

String fileName="sample.txt";

try

{

//Create an instance of File class

file=new File(fileName);

//create a scanner class object

fileScanner=new Scanner(file);

//read file elements until end of file

while (fileScanner.hasNext())

{

double value=fileScanner.nextInt();

elementsCount++;

}

//print smallest value

System.out.println(elementsCount+" data values are read");

}

//Catch the exception if file not found

catch (FileNotFoundException e)

{

System.out.println("File Not Found");

}

}

}

Sample output:

sample.txt

10

20

30

40

50

output:

5 data values are read

5 0
3 years ago
Which of the following tools and techniques shows theimpacts of one decision over another as well as the probability andcost of
Nezavi [6.7K]

Answer: Probability/impact risk matrix

Explanation: Probability/impact risk matrix is type of matrix that defines the probability as well as impact that depicts whether the risk is low ,high or moderate.

Impact matrix is sort of tool which helps in conversion of any plan into a action. Probability matrix help in defining the chances in defining the risk.The positioning of the impact value of risk is plotted  on the vertical axis and performance value on the horizontal axis.

Thus probability/impact matrix is the correct tool for the problem mentioned in the question.

6 0
3 years ago
Explain how you would define a variable named balance, assuming that it will only be accessed in a single function.
olganol [36]

The ways to define a variable named balance, if only it can be accessed in a single function are:

First the variable name need to begin  with a letter or an underscore character (_).

Note that the variable name is one that cannot begin with a digit.

Then make sure that the  variable name can only have alpha-numeric characters and underscores ( a-z, A-Z , 0-9 , and _ )

Note also that  Variable names are the ones that are said to be case-sensitive (age, Age and AGE are said to be different variables)

<h3>How do you define a variable name?</h3>

The Rules for naming a variable is that  A variable name is one that need to have only have letters (that is uppercase and lowercase letters), digits and also an underscore. T

Note that the first letter of a variable can be letter or an underscore.

Learn more about variable name from

brainly.com/question/13162404

#SPJ1

8 0
2 years ago
Mark often gets headaches while working on his computer in the office. What activity can Mark do in the office to prevent headac
svet-max [94.6K]
Mark can prevent these headaches that he is getting on his computer by looking away from his monitor every now and again so he can rest his eyes.
4 0
3 years ago
XBRL: a. Is an XML-based language b. Can be read by almost any software package and easily searched by Web browsers c. All of th
Tema [17]

Answer:

c. All of these choices are correct

Explanation:

XBRL (eXtensible Business Reporting Language) is a freely available and global framework for exchanging business information which uses XML-based data tags to describe financial statements for both public and private companies. It is a normalized version of XML. It leverages efficiencies of the Internet as today’s primary source of financial information by making Web browser searches more accurate and relevant.

Therefore, options a, b and d can be identified in the above definition of XBRL. Therefore,all the choices are correct.

6 0
3 years ago
Other questions:
  • To apply the rule of thirds you first? PLZ HURRY AND ANSWER THIS
    5·2 answers
  • DRU is a small brokerage house that enables its clients to buy and sell stocks over the Internet, as well as place traditional o
    11·1 answer
  • On laptops with a smart card reader installed, where is the smart card reader usually located?
    5·1 answer
  • When activated, an Excel object has all the features of an Excel
    8·2 answers
  • Write a program to calculate the total salary of the employees in an office. The program will first prompt the user to enter the
    9·2 answers
  • To implement a small database, a database designer must know the "1" and the "M" sides of each relationship and whether the rela
    7·1 answer
  • What is python, the coding language
    6·2 answers
  • 1. A bank customer invested $24 in a bank with 5 percent simple interest per year, write a program the construct a table showing
    11·1 answer
  • What did Peter and Rosemary do for a living?<br>​
    13·1 answer
  • Guys, please help me asap (Photo Attached) !!!!!!! HELP 25pts!!!!
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!