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

  Write a haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

These 14 questions covers java class, Array, link list , generic class.

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

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