Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask C/C++ Expert


Home >> C/C++

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.

C/C++, Programming

  • Category:- C/C++
  • Reference No.:- M92079361
  • Price:- $85

Priced at Now at $85, Verified Solution

Have any Question?


Related Questions in C/C++

Question 1find the minimum and maximum of a list of numbers

Question: 1. Find the Minimum and Maximum of a List of Numbers: 10 points File: find_min_max.cpp Write a program that reads some number of integers from the user and finds the minimum and maximum numbers in this list. Th ...

Software development fundamentals assignment 1 -details amp

Software Development Fundamentals Assignment 1 - Details & Problems - In this assignment, you are required to answer the short questions, identify error in the code, give output of the code and develop three C# Console P ...

Assign ment - genetic algorithmin this assignment you will

ASSIGN MENT - GENETIC ALGORITHM In this assignment, you will use your C programming skills to build a simple Genetic Algorithm. DESCRIPTION OF THE PROGRAM - CORE REQUIREMENTS - REQ1: Command-line arguments The user of yo ...

What are the legal requirements with which websites must

What are the legal requirements with which websites must comply in order to meet the needs of persons with disabilities? Why is maximizing accessibility important to everyone?

Project - space race part a console Project - Space Race Part A: Console Implementation

Project - Space Race Part A: Console Implementation INTRODUCTION This assignment aims to give you a real problem-solving experience, similar to what you might encounter in the workplace. You have been hired to complete a ...

There are several ways to calculate the pulse width of a

There are several ways to calculate the pulse width of a digital input signal. One method is to directly read the input pin and another method (more efficient) is to use a timer and pin change interrupt. Function startTi ...

Why do researcher drop the ewaste and where does it end

Why do researcher drop the ewaste and where does it end up?

Assignment word matchingwhats a six-letter word that has an

Assignment: Word Matching What's a six-letter word that has an e as its first, third, and fifth letter? Can you find an anagram of pine grave. Or how about a word that starts and ends with ant (other than ant itself, of ...

1 implement the binary search tree bst in c using the node

1. Implement the Binary Search Tree (BST) in C++, using the Node class template provided below. Please read the provided helper methods in class BST, especially for deleteValue(), make sure you get a fully understanding ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As