Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image

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.

Step by Step Solution

3.41 Rating (151 Votes )

There are 3 Steps involved in it

Step: 1

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... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Java An Introduction To Problem Solving And Programming

Authors: Walter Savitch

8th Edition

0134462033, 978-0134462035

More Books

Students also viewed these Electrical Engineering questions