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]
2 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]2 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
Select the correct answer. One of the functions of a data warehouse is to change table names to meaningful names. Which name is
Marianna [84]

Answer:

A. weekrep101

Explanation:

hope this worked and notice the update

6 0
2 years ago
Write a test program that creates two Rectangle objects—one with width 4 and height 40 and the other with width 3.5 and height 3
BARSIC [14]

Answer:

public class Rectangle {

   private double width;

   private double heigth;

   public Rectangle(double width, double heigth) {

       this.width = width;

       this.heigth = heigth;

   }

   public double getWidth() {

       return width;

   }

   public void setWidth(double width) {

       this.width = width;

   }

   public double getHeigth() {

       return heigth;

   }

   public void setHeigth(double heigth) {

       this.heigth = heigth;

   }

   public double perimeter(double width, double heigth){

       double peri = 2*(width+heigth);

       return peri;

   }

   public double area(double width, double heigth){

       double area = width*heigth;

       return  area;

   }

}

class RectangleTest{

   public static void main(String[] args) {

       //Creating two Rectangle objects

       Rectangle rectangle1 = new Rectangle(4,40);

       Rectangle rectangle2 = new Rectangle(3.5, 35.7);

       //Calling methods on the first Rectangel objects

       System.out.println("The Height of Rectangle 1 is: "+rectangle1.getHeigth());

       System.out.println("The Width of Rectangle 1 is: "+rectangle1.getWidth());

       System.out.println("The Perimeter of Rectangle 1 is: "+rectangle1.perimeter(4,40));

       System.out.println("The Area of Rectangle 1 is: "+rectangle1.area(4,40));

       // Second Rectangle object

       System.out.println("The Height of Rectangle 2 is: "+rectangle2.getHeigth());

       System.out.println("The Width of Rectangle 2 is: "+rectangle2.getWidth());

       System.out.println("The Perimeter of Rectangle 2 is: "+rectangle2.perimeter(4,40));

       System.out.println("The Area of Rectangle 2 is: "+rectangle2.area(4,40));

   }

}

Explanation:

  • Firstly A Rectangle class is created with two fields for width and heigth, a constructor and getters and setters the class also has methods for finding area and perimeters
  • Then a RectangleTest class containing a main method is created and two Rectangle objects are created (Follow teh comments in the code)
  • Methods to get height, width, area and perimeter are called on each rectangle object to print the appropriate value
5 0
2 years ago
Add definitions for the following keywords to your glossary of words.
lianna [129]

Answer:

wifi=a facility allowing computers, smartphones, or other devices to connect to the internet or communicate with one another wirelessly within a particular area.

bandwidth=a range of frequencies within a given band, in particular that used for transmitting a signal.

The bit is the most basic unit of information in computing and digital communications. The name is a contraction of binary digit. The bit represents a logical state with one of two possible values. These values are most commonly represented as either "1" or "0", but other representations such as true/false, yes/no, +/−, or on/off are commonly used.

A megabit is a unit of digital information with prefix mega (symbol M). And it is equal to one million bits. It also means 106 bits or 1,000,000 bits. ... The unit symbol of megabit is Mbit. You can convert megabit to other units of data using our tool.

The gigabit is a multiple of the unit bit for digital information or computer storage. ... 1 gigabit = 109bits = 1000000000bits. The gigabit has the unit symbol Gbit or Gb. Using the common byte size of 8 bits, 1 Gbit is equal to 125 megabytes (MB) or approximately 119 mebibytes (MiB).

The Emergency Broadband Benefit is an FCC program to help families and households struggling to afford internet. The Emergency Broadband Benefit is limited to one monthly service discount and one device discount per household.

Buffering is the process of preloading data into a reserved area of memory that's called a buffer. In the context of streaming video or audio, buffering is when the software downloads a certain amount of data before it begins playing the video or music.

5 0
2 years ago
Write a program that takes a point (x,y) from theuser and find where does the point lies. The pointcan
agasfer [191]

Answer:

C++ Program .

#include<bits/stdc++.h>

using namespace std;

int main()

{

int x,y;//declaring two variables x and y.

string s;//declaring string s..

cout<<"enter x and y"<<endl;

cin>>x>>y;//taking input of x and y..

if(x>=0 &&y>=0) //condition for 1st quadrant..

cout<<"the point lies in 1st Quadrant"<<endl;

else if(x<=0 &&y>=0)//condition for 2nd quadrant..

cout<<"the point lies in 2nd Quadrant"<<endl;

else if(x>=0 &&y<=0)//condition for 3rd quadrant..

cout<<"the point lies in 3rd Quadrant"<<endl;

else //else it is in  4th quadrant..

cout<<"the point lies in 4th Quadrant"<<endl;

cout<<"enter n to terminate the program"<<endl;

while(cin>>s)//if the user has not entered n the program will not terminate..

{

   if(s=="n")

   {

       cout<<"the program is terminated"<<endl;

       exit(0);

   }

   cout<<"you have not entered n please enter n to terminate the program<<endl;

}

}

Explanation:

The above written program is for telling the point lies in which quadrant.I am first declaring two variables x and y.Then after that taking input of x and y after that checking in which quadrant the point lies.

Taking input of the string s declared earlier for program termination the program will keep running until the user enters n.

4 0
3 years ago
What would you NOT use a router for? *
Alla [95]

Answer:

<h2><u>A</u><u>.</u><u> </u><u>To</u><u> </u><u>run</u><u> </u><u>applications</u><u> </u><u>on</u><u> </u><u>your</u><u> </u><u>computer</u></h2>

3 0
3 years ago
Other questions:
  • Which is a good technique for effectively proofreading your presentation?
    7·1 answer
  • How do you delete text from a slide
    14·2 answers
  • I have a question about a hotel tv:
    10·1 answer
  • A(n) monitoring vulnerability scanner is one that listens in on the network and determines vulnerable versions of both server an
    7·1 answer
  • Is this statement true or false?
    12·2 answers
  • Write a program that accepts two numbers R and H, from Command Argument List (feed to the main method). R is the radius of the w
    11·1 answer
  • There is a file of a few Sean Connery movies on the internet. Each entry has the following form:
    9·1 answer
  • When a guest is wearing the medallion, they can order a drink with their smartphone or open their cabin door automatically by st
    13·1 answer
  • What technology would a bank's website use a scramble information as it is transmitted over the Internet
    7·1 answer
  • Which of these would be the fastest transition duration?
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!