Write program using to take input two integers by while loop

Assignment Help Programming Languages
Reference no: EM1366776

Write a program that uses while loops to perform the following steps:
1. Prompts the user to input two integers: firstNum and secondNum. (firstNum must be less than secondNum).
2. Outputs all the odd numbers between firstNum and secondNum.
3. Outputs the sum of all the even numbers between firstNum and secondNum.
4. Outputs all the numbers that when squared are between 1 and 10. So if firstNum is greater than
3 there won't be any numbers that when squared are between 1 and 10.
5. Output the sum of the squares of all the odd numbers between firstNum and secondNum.
Some sampe output may look as follows:
Enter firstNum: 2
Enter secondNum: 12
Odd numbers between 2 and 12 are 3, 5, 7, 9, 11
Sum of the even numbers between 2 and 12 = 42
Numbers that when squared are between 1 and 10: 2, 3
Sum of squares of all odd numbers between 2 and 12 = 285

Reference no: EM1366776

Questions Cloud

Design user-s requirements specification for school : Design a user's requirements specification for the EasyDrive School of Motoring database system. Use a single major user view for the application (Director View)
Determining inverse demand function : Suppose M = $80,000, PR = $30, T = 5, PE = $12, and N = 6,000. Using these, compute and write the direct demand function for Good A. Show your math. Watch the decimals! The coefficient on M is 0.02 and the coefficient on N is .4
Good patient experience and bad patient experience : Most of us have either been patients, or had family members who were patients, in a number of health care facilities. What differentriates a good patient experience from a bad patient experience?
Price and quantity of equilibrium : Discuss if you agree or disagree with this statement and explain your position: Market equilibrium (price and quantity of equilibrium) is just a theoretical result.
Write program using to take input two integers by while loop : Write a program which uses while loops to perform following steps: Prompts user to input two integers: firstNum and secondNum. (firstNum must be less than secondNum).
Question on fundamentals of managerial finance : The Beasley Company has been experiencing declining earnings, but has just declared a 50% salary rise for its top executives. A dissident group of shareholder wants to oust the existing board of directors.
Rising cost of healthcare effect : How does the rising cost of healthcare effect each class of American society. What can Americans do to ensure that the climbing cost of healthcare remains affordable for everyone?
Different kinds of healthcare agencies : Describe the various kinds of healthcare agencies, and how they appear and are employed by members of popular networking sites.
Graphing the events of labor market : Describe the effect of each of the following events on the market for labor in the computer manufacturing industry. Use graphs.

Reviews

Write a Review

Programming Languages Questions & Answers

  Design a website to allow calculation of areas

Design a website to permit calculation of areas. A radio button list can be used to allow the user select what type of area to be calculated. Once the selection is done, the input text boxes should be displayed with the proper labels.

  Accuracy and completeness of computations

Analysis right and you have to develop a plausible argument to "prove" that your analysis is correct

  Communicate with a pc using the rs232c serial protocol

In this assignment we will use the UART0 peripheral to communicate with a PC using the RS232C serial protocol.

  Explain some ways tables can be used on web page

Tables are one of the most useful page layout tools available to web designers. Explain some ways tables can be used on a web page. Elaborate on other ways to achieve the same look.

  Write a program to calculate diameter in centimeters

Write a program to compute the diameter in centimeters of steel rod, aluminum rod, adn copper rod, which can withstand a particular compression load.

  Design pseudocode to enter names of two primary colors

Design a pseudocode program that prompts the user to enter the names of two primary colors to mix. If the user enters anything other than "red", "blue", or "yellow".

  Program to generate a random number between a range

Write down a program to generate random number between 1 and 100 and asks user to guess what number is.

  Use-professional translator in creting website-other country

When and why would you need to use the services of a professional translator to help prepare your website for an audience in another country?

  Create a print stream object using dos

Create a PrintStream object using dos and assign the resulting reference to ps, a PrintStream variable that has already been declared.

  Function to convert a decimal input into roman numerals

Write a function that converts a decimal input into Roman Numerals. Your function will take in a number and output a string.

  Create xml document to mark nutrition facts for cookies

Create an XML document that marks up the nutrition facts for a package of Grandma White's cookies. A package of cookies has a serving size of 1 package and the following nutritional value per serving.

  Program to swap values from variables

Given two int variables, firstPlaceWinner and secondPlaceWinner , write some code that swaps their values. Declare any additional variables as necessary.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd