Question

​​​​​​WRITE FLOWCHART AND PSEUDOCODE ONLY (C++) Write the flowchart and pseudocode for the following program (but...

​​​​​​WRITE FLOWCHART AND PSEUDOCODE ONLY (C++)

  1. Write the flowchart and pseudocode for the following program (but not the program itself.)
    In a right triangle, the square of the length of one side is equal to the sum of the squares of the lengths of the other two sides. ( sidea2 = sideb2 + sidec2 / sideb2 = sidea2 + sidec2 / …..)

The program will read three side lengths from a text file, and then print the lengths along with a message stating if the triangle is a right triangle. (Remember the side lengths may be in any order in the file.) Name your file Lab5B.

Homework Answers

Answer #1

#include <iostream>

using namespace std;

int main()
{
   float a,b,c,side1,side2,side3;
   cout<<"Enter side1:";
   cin>>a;
   cout<<"Enter side2:";
   cin>>b;
   cout<<"Enter side3:";
   cin>>c;
   side1=a*a;
   side2=b*b;
   side3=c*c;
   if(side1==side2+side3){
  
   cout<<"The triangle is a right triangle";
   }   
else{
   cout<<"The triangle is not a right triangle";
   }
  
  
}

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Write a basic c++ program to check whether a triangle is valid or not if the...
Write a basic c++ program to check whether a triangle is valid or not if the three sides are given: A triangle is valid if the sum of its two sides is greater than the third side. Let’s say that a, b, c is the sides of the triangle. A valid triangle must satisfy all these conditions: a + b > c a + c > b b + c > a (2 points) Generate random numbers 1-15 inclusive for...
Include a pseudocode or flowchart of your process. Use a loop structure to write a C++...
Include a pseudocode or flowchart of your process. Use a loop structure to write a C++ program that A) Finds and displays how many multiples of 8 there are in between 1 to 1000 . B) Displays all the multiples of 8 between 1 ~ 1000 , separated with commas. C) Finds and displays the sum of all the multiples of 8 in between 1 to 1000.
Function Example: Write a Python function that receives two integer arguments and writes out their sum...
Function Example: Write a Python function that receives two integer arguments and writes out their sum and their product. Assume no global variables. def writer(n1, n2): sum = n1 + n2 product = n1*n2 print("For the numbers", n1, "and", n2) print("the sum is", sum) print("and the product is", product) ... 1) Create a PYHW2 document that will contain your algorithms in flowchart and pseudocode form along with your screen shots of the running program. 2) Create the algorithm in both...
I need python code for this. Write a program that inputs a text file. The program...
I need python code for this. Write a program that inputs a text file. The program should print the unique words in the file in alphabetical order. Uppercase words should take precedence over lowercase words. For example, 'Z' comes before 'a'. The input file can contain one or more sentences, or be a multiline list of words. An example input file is shown below: example.txt the quick brown fox jumps over the lazy dog An example of the program's output...
Collapse Write a program that prompts the user to input a positive integer. It should then...
Collapse Write a program that prompts the user to input a positive integer. It should then output a message indicating whether the number is a prime number. (Note: An even number is prime if it is 2. An odd integer is prime if it is not divisible by any odd integer less than or equal to the square root of the number.) Turn in: Your source code for with The name of your program as a comment at the top...
You will write a program that loops until the user selects 0 to exit. In the...
You will write a program that loops until the user selects 0 to exit. In the loop the user interactively selects a menu choice to compress or decompress a file. There are three menu options: Option 0: allows the user to exit the program. Option 1: allows the user to compress the specified input file and store the result in an output file. Option 2: allows the user to decompress the specified input file and store the result in an...
C# Reading from Files Write a program to open a text file containing information about buildings....
C# Reading from Files Write a program to open a text file containing information about buildings. The program must display all the buildings in the file and then find the lowest cost building based on the cost per square foot. Format for one building: <building name> <size> sqft $<cost> Example: Allgood Hall 35000 sqft $8,250,099.75 Create the text file and add three or more of your favorite buildings.
C# Reading from Files Write a program to open a text file containing information about buildings....
C# Reading from Files Write a program to open a text file containing information about buildings. The program must display all the buildings in the file and then find the lowest cost building based on the cost per square foot. Format for one building: <building name> <size> sqft $<cost> Example: Allgood Hall 35000 sqft $8,250,099.75 Create the text file and add three or more of your favorite buildings.
Write a program that does the following in C++ 1 ) Write the following store data...
Write a program that does the following in C++ 1 ) Write the following store data to a file (should be in main) DC Tourism Expenses 100.20 Revenue 200.50 Maryland Tourism Expenses 150.33 Revenue 210.33 Virginia Tourism Expenses 140.00 Revenue 230.00 2 ) Print the following heading: (should be in heading function) Store name | Profit [Note: use setw to make sure all your columns line up properly] 3 ) Read the store data for one store (should be in...
c# please Create a “Main” program which reads a text file called “collectionOfWords.txt”. Include exception handling...
c# please Create a “Main” program which reads a text file called “collectionOfWords.txt”. Include exception handling to check if the file exists before attempting to open it. Read and print each string to the console. Next modify each word such at the first letter in each word is uppercase and all other letters are lowercase. Display the modified word on the console. Creating a text file: Open up Notepad and type in the following words. Save the file as collectionOfWords.txt...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT