Prompt the user to enter two numbers followed by an operator

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

Programming C/C++ assignments

You'll need to download this To write the program. The programs will be written using the Microsoft Visual C++ Express Edition IDE (Integrated Development Environment), which can be downloaded from the Microsoft Web Site.

For your assignment to be graded, you must identify yourself by including a comment block at the beginning of your program source code. This comment block must include your name, the date, the assignment number, and your student identification number. You also must provide a description and list of key variables and parameters used.

An example of the minimum C++ comment block is:

/**

* Name: Who you are.(ask me)

* Date: When you did the work.ask me

* Assignment: Number 1

* Student Number: AAXXXXXXX ask me

* Description: This program does a, b, and c.(what it does)

*/

Programming in C/C++

Assignment 1

Write a console program to:

1. Prompt the user to enter two numbers followed by an arithmetic operator

( +, -, / or *).

2. Do the specified arithmetic operation and display the result as both an integer and a floating point number, on separate lines.

3. If the result of the calculation is between 1 and 100 display a message that indicates this.

4. Prompt the user to enter their first and last name (with a space in between.) Use the getline( ) function to read in the name.

5. On a new line display the sentence: "This program was written by your name." (your name should be in all Uppercase.) ask me

Example: This program was written by JOE SMITH ask me

Assignment 2

Write a console program to:

1. Prompt the user to enter two decimal numbers followed by an arithmetic operator

( +, -, / or *).

2. Call a function to do the specified arithmetic operation and return the result

3. Display the arithmetic expression followed by an equal sign followed by the result as a floating point number, with 2 decimal places and then with 3 decimal places on separate lines.

Example: 3.00 + 2.00 = 5.00

4. Prompt the user to see if they want to do more calculations. Allow the user to do more calculations until they enter either an ‘N'or an ‘n' for no.

5. Use a for-loop to display 5 random numbers. Display a heading above the random numbers.

6. Prompt the user to enter their first and last name (with a space in between.) Use the getline( ) function to read in the name.

7. On a new line display the sentence: "This program was written by your name." (your name should be in all Uppercase.) (ask me)

Example: This program was written by JOE SMITH (ask me)

Note: Make your program user friendly. The prompts should be informative and descriptive. The output should be displayed in an easy to read format (not all packed together). Remember to use whitespace to make it readable

Assignment 3

Write a console program to do Chapter 12 Exercise 3,

In this exercise, you complete a program that displays the color of an item.

A. Code the program so that it displays the color of the item whose item number is entered by the user. All item numbers contain exactly five characters. All items are available in four colors: blue, green, red, and white. The third characters in the item number indicates the item color, as follows:

Character Color

B or b Blue

G or g Green

R or r Red

W or w White

For example, if the user enters 12b45, the program should display the word "blue" on the screen. If the item number does not contain exactly five characters, or if the third character is not one of the characters listed above, the program should display an appropriate message on the screen.

B. Save then build the solution.

C. Execute the program. Test the program using the following item numbers: 12x, 12b45, 99G44, abr55, 78w99, and 23abc.

D. When the program is working correctly, close the Output window, then use the file menu to close the solution.

Note: The program should use a void function to check the item number to determine the color of the item, and the color should be given to the calling function by using a reference variable. Use an array to store the colors and corresponding characters.

Assignment 4

Write a console program to:

1. Read an input file that contains sets of 3 numbers separated by the delimiter (#) until the end of file. Check that the file was successfully opened.

2. All program output should be written to the output file "ProgrammingAssignment4_Output.txt"

3. For each set of 3 numbers, determine if the 3 values can form the sides of a triangle. (The sum of the lengths of any two sides of a triangle must be greater than the length of the third side. For Example, the numbers 3, 4, and 5 can form a triangle because 3+4 > 5, 4+5 > 3, and 5+3 > 4. In contrast, the numbers 1, 2, and 5 cannot form a triangle because 1+2 < 5. Thus, if you are given any three integers, you can determine whether they could possibly form a triangle or not by applying this general principle.)

4. If the values cannot form a triangle, display the appropriate message in the output file. For those sets of numbers that can form a triangle, display the type of triangle and the perimeter of the triangle. (Use the triangle class described below to determine the type and perimeter, but create the output in the main method.) Example: The values 3, 4 and 5 form a right triangle with perimeter = 12. The values 1, 1, and 10 cannot form a triangle.

5. Create a Triangle class that contains a constructor and 4 methods. The constructor must set the values of the sides of the triangles. There should be a method to do each of the following: a. Calculate and return the perimeter of the triangle b. Determine if the triangle is a right triangle (a2 + b2 = c2, where c is the hypotenuse - the largest side), Return True if it is, and False if it is not. c. Determine if the triangle is an equilateral triangle (all 3 sides are equal). Return True, if it is and False if it is not. d. Determine if the triangle is an isosceles triangle (only 2 sides are equal). Return True, if it is and False if it is not.

Reference no: EM131324762

Questions Cloud

Determine the dominant strategy for sami : If the two firms can enter into a binding and enforceable agreement, determine the strategy that each firm should choose.
Can engineers hold public welfare paramount : Can engineers hold public welfare paramount?Explain the nature of the problem. Can we approach Engineering as a science? Give pros and cons of your argument. Is there hope that the rights of privacy will survive? Provide an argument that will su..
Respiratory-digestive-urinary and reproductive systems : Focusing on the respiratory, digestive, urinary, and reproductive systems. Create a scenario and give your patient a disease associated with any of these systems and present the history and symptoms of the particular disease below the question.
Find the financial break-even quantity : Consider a project with the following data: accounting break-even quantity = 5,500 units; cash break-even quantity = 5,000 units; life = eight years; fixed costs = $140,000; variable costs = $22 per unit; required return = 12 percent. Ignoring the ef..
Prompt the user to enter two numbers followed by an operator : Prompt the user to enter two numbers followed by an arithmetic operator. Do the specified arithmetic operation and display the result as both an integer and a floating point number, on separate lines.
What was the nature of the threat : What was the nature of the threat that the Confidence Man posed to the individual and society? What were the various types of Confidence Men? What distinctive societal fears did each type of Confidence Men represent
What is the current share price if the required return : A Treasury bond has a face value of $10,000 and is currently priced at $10,165.33. The bond has a current yield of 6.276 percent. What is the coupon rate on a $10,000 bond? Hi-Tek plans to pay a $6 per share dividend one year from today, and will inc..
Develop a payoff matrix for this decision-making problem : Explain why the firms may choose not to play their dominant strategies whenever this game is repeated over multiple decision-making periods.
Three economic scenarios before any debt is issued : Kaelea, Inc., has no debt outstanding and a total market value of $194.775. Earnings before interest and taxes, EBIT, are projected to be $13,800 if economic conditions are normal. If there is strong expansion in the economy, then EBIT will be 20 per..

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