Q#1: Write a program that prints the numbers from 1 to 1000 On the same line...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Q#1: Write a program that prints the numbers from 1 to 1000 On the same line it should also print their square. For example 1. Squared = 1 2. Squared = 4 3. Squared = 9 4. Squared = 16 5. Squared = 25 Ref Range Looping slides (Part 2 Lecture 8, Range Looping) Q#2: Write a program to convert centigrade to Kelvin. It should display value in centigrade and then the value in Kelvin just as you displayed squares in the previous question. The range to be followed for this conversion is from 50-100 degree celsius. Q#3: Write a program using if, and elif and else, that asks the user what their favorite food is. Then for at least 4 different foods tell the user how you feel about that food. If they type in a type of food that doesn't match, (else) then tell them that you don't care about that food much. For example >>> What is your favorite food? >>>Pizza >>> How do you feel about hotdog? Please only enter Y for good, N for bad. >>> N >>> How do you feel about cake? Please only enter Y for good, N for bad. >>> N >>>How do you feel about apples? Please only enter Y for good, N for bad. >>> N >>> How do you feel about noodles? Please only enter Y for good, N for bad. >>> N >>> I don't care about much about Pizza either. Q#1: Write a program that prints the numbers from 1 to 1000 On the same line it should also print their square. For example 1. Squared = 1 2. Squared = 4 3. Squared = 9 4. Squared = 16 5. Squared = 25 Ref Range Looping slides (Part 2 Lecture 8, Range Looping) Q#2: Write a program to convert centigrade to Kelvin. It should display value in centigrade and then the value in Kelvin just as you displayed squares in the previous question. The range to be followed for this conversion is from 50-100 degree celsius. Q#3: Write a program using if, and elif and else, that asks the user what their favorite food is. Then for at least 4 different foods tell the user how you feel about that food. If they type in a type of food that doesn't match, (else) then tell them that you don't care about that food much. For example >>> What is your favorite food? >>>Pizza >>> How do you feel about hotdog? Please only enter Y for good, N for bad. >>> N >>> How do you feel about cake? Please only enter Y for good, N for bad. >>> N >>>How do you feel about apples? Please only enter Y for good, N for bad. >>> N >>> How do you feel about noodles? Please only enter Y for good, N for bad. >>> N >>> I don't care about much about Pizza either.
Expert Answer:
Answer rating: 100% (QA)
Answer Question 1 program to print the numbers from 1 to 1000 on the same line it should also print their square Program with Explanation for i in range11001 line1 print0 squared 1formatiii line2 Expl... View the full answer
Related Book For
Java An Introduction To Problem Solving And Programming
ISBN: 9780134462035
8th Edition
Authors: Walter Savitch
Posted Date:
Students also viewed these electrical engineering questions
-
For this program you will write a program that will do the following: Read in the numbers from the text file (Values.txt) and store those values in an array. You will declare the array of size 20....
-
Write a program that receives an ASCII code (an integer between 0 and 127) and displays its character. For example, if the user enters 97, the program displays the character a. Here is a sample run:...
-
Write a program that prints a multiplication table, like this: 3 4 5 6 4 6 8 10 12 14 16 18 20 9 12 15 18 21 24 27 30 7 8 9 10 1 2 2 3 10 20 30 40 50 60 70 80 90 100
-
when taking a lead role for supplier selection can often help Multiple select question. establish supplier quality standards. determine price. develop the engineering specifications. set conditions...
-
What does the poverty rate measure? Describe three potential problems in interpreting the measured poverty rate.
-
Whats the default sort sequence for the ORDER BY clause? a. Ascending b. Descending c. The order in which records are stored in the table d. Theres no default sort sequence.
-
What the methods are for service of a summons and complaint?
-
On August 31, the balance sheet of Nashville Veterinary Clinic showed Cash $9,000, Accounts Receivable $1,700, Supplies $600, Office Equipment $6,000, Accounts Payable $3,600, Common Stock $13,000,...
-
Use a 10-year planning horizon, and whatever interest rate(s) you determine to be appropriate. Assume that all assets will be sold off at the end of the ten years. The effects of depreciation should...
-
1. A saturated sample of soil weighed 138.89g before drying and 112.89 after drying.If the dimensions of the sample were 35mm diameter and 70mm long, calculate: 2. The voids ratio to 3 decimal...
-
Complete Keith's tax return including all required schedules and forms using prince edward island as province, using the fillable forms package. Taxpayers Information Taxpayer #1 Name: Keith Dox...
-
2. Write ARM Thumb-2 Assembly language code to perform the following logic: int Chose (int choice) 1 switch (choice) { case 'A': print("You choose: A "); break; case 'B': print("You choose: B ");...
-
A long uniform rod of length L and mass M is pivoted about a horizontal, frictionless pin through one end. Another small mass of M is attached to the other end of the rod. The rod is released from...
-
The ideal air to fuel ratio for an engine is 14.8:1. If a vehicle burns 7 lb of fuel, how many pounds of air should it draw to achieve the ideal ratio
-
Outline a test strategy with at least 4 test cases for the program portion given below. Provide justification for the test cases you have chosen by referring to some of the test heuristics you have...
-
The Alpine House, Incorporated, is a large retailer of snow skis. The company assembled the Information shown below for the quarter ended March 31: Sales Selling price per pair of skis Variable...
-
What is the minimum a scarf would be traded for in this example? 1/2 Sweater 1/3 Sweater 2 sweaters 3 sweaters Alexandra's Production Possibilities Schedule Number of Scarfs Knitted per day 0 3 6 9...
-
Why is disclosure of depreciation or amortization methods and rates so important?
-
Create a GUI application that draws the following picture of a magic wand, using polygons and polylines:
-
Define the following methods for the class Ledger, as described in the previous exercise: getAverageSale()returns the average value of all the sales getCountAbove(v)returns the number of sales that...
-
Write a static method blur(double[][]picture) that you could use on a part of a picture file to obscure a detail such as a persons face or a license plate number. This method computes the weighted...
-
Green, CPA, is considering audit risk at the financial statement level in planning the audit of National Federal Bank (NFB) Company's financial statements for the year ended December 31, 19X0. Audit...
-
For the following sets of circumstances, indicate whether the auditor would have a high or low risk of failing to detect these circumstances with appropriate audit procedures. Give reasons for your...
-
Using the audit risk model, calculate detection risk if the other risks are set at these levels. a. Individual audit risk of 5 percent. Inherent risk of 50 percent. Control risk of 40 percent. b....
Study smarter with the SolutionInn App