Question

In: Computer Science

Create a project that gets input from the user. ( Name the project main.cpp) Ask the...

Create a project that gets input from the user. ( Name the project main.cpp)

Ask the user for a value for each side of the triangle.

Comment your code throughout.

Include your name in the comments.

Submit the plan-Psuedo code (include Flowchart, IPO Chart) and the desk check with each submission of your code.

Submit the plan as a pdf.

Snips of your output is not a plan.

  • Save the plan and desk check as a pdf
  • Name the code main.cpp

Not a triangle

Expected Output

Remember to submit each time items below along with your code.

Plan (Psuedo code, Flowchart, IPO Chart)

Desk check

Starter Code:

"Welcome user. Type in the side lengths of your triangle and I will classify it. "<<endl;
"Enter the length of each side. "<<endl;


"This is not a triangle. All side lengths must be greater than zero."<<endl;


"This is not a triangle because the sum of the\ntwo smaller side lengths is not greater than the largest side length."<<endl;


"Your triangle is ";


"an equilateral triangle because all side lengths are equal."<<endl;

"a scalene triangle because no side lengths are equal."<<endl;

"an isosceles triangle because only two side lengths are equal."<<endl;

Solutions

Expert Solution

Code:


#include <iostream>
using namespace std;
int main() {
int a,b,c; //to store the value of sides of tringle
cout<<"Welcome user. Type in the side lengths of your triangle and I will classify it. "<<endl<<"Enter the length of each side. "<<endl;

cin >> a; //this take input from user
cin >> b;
cin >> c;
if(a<=0||b<=0||c<=0) //check for negative side value
cout<<"This is not a triangle. All side lengths must be greater than zero."<<endl;
else if(a+b<=c||a+c<=b||b+c<=a)
cout<<"This is not a triangle because the sum of the\ntwo smaller side lengths is not greater than the largest side length."<<endl;
else {
cout<<"Your triangle is ";
if(a==b==c)
cout<<"an equilateral triangle because all side lengths are equal."<<endl;
else if(a==b||b==c||c==a)
cout<<"an isosceles triangle because only two side lengths are equal."<<endl;
else
cout<<"a scalene triangle because no side lengths are equal."<<endl;
  
}
return 0;
}

flow chart


Related Solutions

Create a small program that contains the following. ask the user to input their name ask...
Create a small program that contains the following. ask the user to input their name ask the user to input three numbers check if their first number is between their second and third numbers
Task 2.5: Write a script that will ask the user for to input a file name...
Task 2.5: Write a script that will ask the user for to input a file name and then create the file and echo to the screen that the file name inputted had been created 1. Open a new file script creafile.sh using vi editor # vi creafile.sh 2. Type the following lines #!/bin/bash echo ‘enter a file name: ‘ read FILENAME touch $FILENAME echo “$FILENAME has been created” 3. Add the execute permission 4. Run the script #./creafile.sh 5. Enter...
Ask the user for their name Create a file called "daily.dat" within the home directory Ask...
Ask the user for their name Create a file called "daily.dat" within the home directory Ask the user for a line of text that the system should save to the file Add to the file the line of text entered by the user Ask the user for a second line of text that the system should save to the file Append at the end of the file the line of text entered by the user Create a copy of the...
using C language Create a bitwise calculator that ask user for input two input, first int,...
using C language Create a bitwise calculator that ask user for input two input, first int, bitwise operation, second int (i.e 5 & 9) only those bitwise operation are allowed: & ~ ^ | << >>. If user uses wrong operators stop program and ask again. Convert the first int and second int into 8 BITS binary (00000000) and use bitwise operator given by user to either AND, OR, XOR, etc (ie 1001 & 1111)
Create a simple shopping cart application. Ask the user to input an item number and quantity....
Create a simple shopping cart application. Ask the user to input an item number and quantity. Update the shopping cart. Display the updated cart. Include the following when displaying cart: item number, name, quantity and total price. Ask for another update or end the program. Design Requires 2 classes: the main class and the cartItem class In the main class: Need one array named cartArray of type cartItem. Size = ? Need a loop that asks the user for input....
Create a simple shopping cart application. Ask the user to input an item number and quantity....
Create a simple shopping cart application. Ask the user to input an item number and quantity. Update the shopping cart. Display the updated cart. Include the following when displaying cart: item number, name, quantity and total price. Ask for another update or end the program. Design Requires 2 classes: the main class and the cartItem class In the main class: Need one array named cartArray of type cartItem. Size = ? Need a loop that asks the user for input....
This assignment asks to create an array with 10 integer elements. Ask user to input 10...
This assignment asks to create an array with 10 integer elements. Ask user to input 10 integer values. going through all the array elements and find/print out all the prime numbers. Instructions: Only use for loops for this lab (no need to create methods or classes for this assignment). Put a comment on each line of your codes, explaining what each line of code does. basic java, please
Create a CodeBlocks project with a main.cpp file. Submit the main.cpp file in Canvas. C++ Language...
Create a CodeBlocks project with a main.cpp file. Submit the main.cpp file in Canvas. C++ Language A Game store sells many types of gaming consoles. The console brands are Xbox, Nintendo, PlayStation. A console can have either 16 or 8 gigabytes of memory. Use can choose the shipping method as either Regular (Cost it $5) or Expedite (Cost is $10) The price list is given as follows: Memory size/Brand Xbox Nintendo PlayStation 16 gigabytes 499.99 469.99 409.99 8 gigabytes 419.99...
Create a program that keeps track of the following information input by the user: First Name,...
Create a program that keeps track of the following information input by the user: First Name, Last Name, Phone Number, Age Now - let's store this in a multidimensional array that will hold 10 of these contacts. So our multidimensional array will need to be 10 rows and 4 columns. You should be able to add, display and remove contacts in the array. In Java
Create a program (Python) YourFirstnameLastnameA06b.py to ask the user to create a password: The user will...
Create a program (Python) YourFirstnameLastnameA06b.py to ask the user to create a password: The user will first enter a password, then enters the same password again; If the second input is the same as first one, the user successfully creates the password. Print “Well done.”; Otherwise, the user will be directed to repeat the whole process (go to step 1.)
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT