subject

Lab 5-3 Using a for Loop

The completed program should print the numbers 0 through 10, along with their values multiplied by 2 and by 10. However, in this lab you should accomplish this using a for loop.

1. Open the source code file named NewMultiply. java using Notepad or the text editor of your choice.

2. Write a for loop that uses the loop control variable to take on the values 0 through 10.

3. In the body of the loop, multiply the value of the loop control variable by 2 and by 10.

4. Save this source code file in a directory of your choice, and then make that directory your working directory.

5. Compile the source code file NewMultiply. java .

6. Execute the program. Is the output the same as Lab 5-1?

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 21:30
Asuccessful format string attack attempted to steal user account information by reading from unauthorized memory. answer the followings with proper explanation a)this attack will lead to violation of which security policies?
Answers: 2
question
Computers and Technology, 23.06.2019 23:30
A. in packet tracer, only the server-pt device can act as a server. desktop or laptop pcs cannot act as a server. based on your studies so far, explain the client-server model.
Answers: 2
question
Computers and Technology, 24.06.2019 02:10
Aspeed limit sign that says "night" indicates the legal speed between sunset and sunrise.
Answers: 2
question
Computers and Technology, 24.06.2019 16:50
7.23 main lab 7 - online shopping cart background this main lab extends the earlier prep lab "online shopping cart part 1". (you should save this as a separate project from the earlier prep lab). you will create an on-line shopping cart like you might use for your on-line purchases. the goal is to become comfortable with setting up classes and using objects. requirements this lab can be done individually or as pair programming. expanded itemtopurchase class (15 points) extend the itemtopurchase class as follows. we will not do unit testing in this lab so we will not be giving you the names of the member functions. create good ones on your own. create a parameterized constructor to assign item name, item description, item price, and item quantity (default values of "none" for name and description, and 0 for price and quantity). additional public member functions set an item description get an item description print the cost of an item - outputs the item name followed by the quantity, price, and subtotal (see example) print the description of an item - outputs the item name and description (see example) additional private data members a string for the description of the item. example output of the function which prints the cost of an item: bottled water 10 @ $1.50 = $15.00 example output of the function which prints the item description:
Answers: 1
You know the right answer?
Lab 5-3 Using a for Loop

The completed program should print the numbers 0 through 10, a...
Questions
question
Chemistry, 20.09.2021 19:10
question
Computers and Technology, 20.09.2021 19:10
question
Mathematics, 20.09.2021 19:10
question
Mathematics, 20.09.2021 19:10
question
Mathematics, 20.09.2021 19:10
Questions on the website: 13722367