Write a cpp program that will present the user with a menu

Assignment Help C/C++ Programming
Reference no: EM131197022

Computer Science

Program-

Write a C++ program that will:

Present the user with a menu of choices:

1. Random number
2. String
3. Type Casting
4. Integer Math

Then, in an if-else if structure (or switch) write the code for each option.

Option 1:

Write out a random number in the range of -5 to 5 (including both 5 and -5). The program should be able to write out a different random number each time the program is run.

Option 2:

Prompt the user and read in a string (that contains blank spaces) from the keyboard. Write out the length of the input string along with the first and last characters in the string.

Option 3:

Ask the user for an integer in the range of 33-126, and read this integer in from the keyboard. Treating this integer as an ASCII value, write out the character that the number represents.

Then, ask the user for a character input and read their input into a char variable. Write out the ASCII value that the computer uses to represent this input character.

Option 4:

Ask the user for 2 integers and read them into 2 int variables (i.e.A,B). Using only +=, -=, and *=,
add the two int variables and store the result in the first input variable ( A <- A + B)
subtract the first input variable from the second, storing the result to the second (B <- B - A).
add the two variables and store the result to the first input variable (A <- A + B)
multiply the second variable by -1 and store the result back into the same variable (B <- B * -1).

Write out the new values of the two variables (in original order A,B) Write out text messages with all numeric output to explain what has been done

Required Comments:

Name block (your name, course number, assignment number)

After the name block: A simple description of what the program does. Before each option in the if-else if, briefly say what that section is for.

Reference no: EM131197022

Questions Cloud

Calculate the minimum number of plates : The feed is cold, and for each mole of feed 0.15 mole of vapor is condensed at the feed plate.  The reflux ratio at the top of the column is 1.4, and the reflux is at its bubble point.  Calculate the minimum number of plates
Determining the constant volume process : During an Adiabatic compression in an engine, the volume is reduced to 0.0625 of its initial value. Heat is then added at constant pressure until the initial volume is attained again. The cycle is completed by a constant volume process.
Explain the major theoretical paradigms of sociology : Define the basic concepts used in the discipline of sociology. Explain the major theoretical paradigms of sociology. Use technology and information resources to research issues in sociology.
Relationship between personality and job performance : Explain how OB scholars and leaders should apply this knowledge in organisations - Conduct academic research to decide and explain your answer.
Write a cpp program that will present the user with a menu : Write a C++ program that will Present the user with a menu of choices Random number, String, Type Casting and Integer Math.
Calculate the escape velocity of the moon : a). Write an essay to explain why the polar regions of the Moon are the most favourable sites for the establishment of a lunar base. b). Calculate the escape velocity of the Moon in units of km/s
Address animal welfare and environmental concerns : Question 1: The article calls for public policy initiatives to address animal welfare and environmental concerns associated with dairy farming. With reference to economic concepts covered in this course, explain why the government might want to in..
Compute the mean and variance of this distribution : The lifetime distributions of high-speed recordable optical disks is assumed to follow lognormal distribution (Irine and Okino, IEEE Trans. on Magnetics, 2007). Suppose μ = 2.5 and σ = 0.5 weeks.
Personal injury lawyers may be paid a contingency fee equal : Personal injury lawyers may be paid a contingency fee equal to a percentage of the amount awarded. The lawyer receives payment only if his or her client wins the case and is awarded a sum of money. Lawyers in other types of cases are often paid on an..

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

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