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

  How will you do the shrink operation

How will you do the shrink operation and how will you do the expand operation -

  Derive class weekday from class datetime

We can retrieve any one of the date-time structure member using strftime - Derive class WeekDay from class DateTime such that WeekDay::display() will display local date time using values from the parameters and the corresponding weekday.

  Prepare a simple game of blackjack using object oriented

prepare a simple game of blackjack using object oriented programming.uml class diagramsyour project must implement the

  Compute the average of an array of n 8-bit numbers

Write a program to compute the average of an array of N 8-bit numbers and store the result at $1000. The array is stored at memory locations starting from $1010. N is no larger than 255.

  Create four child processes

1. Using Fork() and Exec() or Clone(), create four child processes. Load the same “Hello” program in each process after creation. This program should behave differently in each process.

  Write a menu-driven program that maintains an address book

Write a menu-driven program that maintains an address book using a linked list. The address book must supports the following operations

  The authors of the book do a very thorough job explaining

the authors of the book do a very thorough job explaining simpletons operation and encourage you to take a look at what

  Compute sums for each of the two inventories

The object is to compute sums for each of the two inventories and generate a total inventory count for each one. i need to print out the total number of items found in each inventory, total counts and the average for each inventory.

  Prints out michael 10 times using a loop

Prints out "Michael" 10 times using a loop - Inputs 2 floats from the user

  Knowledge of c programming principles

Implement a moderate size program to demonstrate early knowledge of C programming principles - what will be a fun assignment, a two player version of the game "Connect 4". Connect 4 is a rather simple game.

  Write program to perform add-drop-list and update functions

Write C++ program to do add, drop, list (in last name / first name sorted order or id) and update functions. separate UI from data processing use object programming method multiple files

  Program to report on the roots of a quadratic equation

Write a complete C++ program to report on the roots of a quadratic equation ax2 + bx + c = 0, a ≠ 0. compute the roots.

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