1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
GuDViN [60]
1 year ago
11

Question: 4/8

Computers and Technology
1 answer:
Gemiola [76]1 year ago
8 0

The generated test cases for the function assuming another developer coded the function is given below in a C++ program.

<h3>THE CODE</h3>

#include <iostream>  

#include <iomanip>

#include <string>

using namespace std;

// define the data type "triangletype" with {values}

enum triangleType { scalene, isosceles, equilateral, noTriangle };

// Prototype function which returns the position of triangleType{value}

// Example: Scalene = 0, isosceles = 1, etc. These are zero indexed.

triangleType triangleShape(double a, double b, double c);

// Prototype function which takes the integer value of the

// triangle type and outputs the name of triangle

string shapeAnswer(int value);

int main() {

   double inputA;

   double inputB;

   double inputC;

   cout << "To determine whether a triangle is either:" << endl;

   cout << setw(50) << " - Scalene" << endl; // Unequal in length

   cout << setw(52) << " - Isosceles" << endl; // Two sides equal length

   cout << setw(54) << " - Equilateral" << endl; // All sides equal

   cout << setw(57) << " - Not a triangle" << endl;

   cout << "Enter side A: ";

   cin >> inputA;

   cout << "Enter side B: ";

   cin >> inputB;

  cout << "Enter side C: ";

   cin >> inputC;

   cout << "The triangle is " << shapeAnswer(triangleShape(inputA, inputB, inputC)) << endl;

}

triangleType triangleShape(double a, double b, double c) {

   triangleType answer;

   if ( c >= (a + b) || b >= (a + c) || a >= (b + c) ) {

       answer = noTriangle;

   }

   else if (a == b && b == c) {

       answer = equilateral;

   }

   // Test the 3 options for Isosceles equality

   else if ( (a == b) && (a != c) || (b == c) && (b != a) || (a == c) && (a != b) ) {

       answer = isosceles;

   }

   else {

       answer = scalene;

   }

   return answer;

}

string shapeAnswer(int value) {

   string answer;

  switch (value) {

   case 0:

       answer = "Scalene";

       break;

   case 1:

       answer = "Isosceles";

       break;

   case 2:

       answer = "Equilateral";

       break;

   case 3:

       answer = "Not a triangle";

       break;

   default:

       break;

   }

   return answer;

}

Read more about C++ programs here:

brainly.com/question/20339175

#SPJ1

You might be interested in
Approximately what percentage of the world population owns a smartphone?
Usimov [2.4K]
The number of smartphone users is forcast to grow from 2.1 billion in 2016 to around 2.5 billion in 2019, with smartphone penetration rates increasing as well.over 36% of the worlds population is projected to use a smartphone by 2018, thats up from about 10% in 2011
5 0
3 years ago
The __is the temporary storange location for text when it is cut from a document
enot [183]
The informal answer to your question is "clipboard". However, there isn't such a thing as the "clipboard". The people who came up with the idea of the clipboard use that nomenclature to describe the location in memory where that copied data resides. So the formal answer to your question is memory or RAM.
3 0
3 years ago
Technician A says that the excessive length of a heater hose is intended to protect the heater core from undue stress. Technicia
hammer [34]
It is both true that <span>Technician A says that the excessive length of a heater hose is intended to protect the heater core from undue stress. Technician B says that excessive wear adds to the length of a heater hose, and a replacement heater hose should be roughly three to four inches shorter than its predecessor.  So the asnwer is letter B.</span>
6 0
3 years ago
a 0.600 kg dynamics trolley has 1.5 kg load added. It is launched with a force of 10.n what is the acceleration
Anastaziya [24]

Answer:

acceleration = 4.76 m/s²

Explanation:

Given that"

the mass of the dynamic trolley = 0.6 kg

the mass of the load  = 1.5 kg

total mass = (0.6 + 1.5) kg = 2.1 kg

the force = 10 N

Thus;

using the formula of force which is;

Force = mass × acceleration

10 = 2.1  × acceleration

acceleration = 10/2.1

acceleration = 4.76 m/s²

7 0
2 years ago
What evaluates variables that search engines use to determine where a URL appears on the list of search results?
RSB [31]

Answer:

The correct answer is "Search engine ranking".  

Explanation:

The search engine is also known as an Internet search engine that is developed for searching the website or the web. The search engine is a type of software system. When we search anything into the web there are so many website or related links are appeared the Search engine ranking means on searching on the top which is appeared or which appeared in bottom simply it gives the position of the searching web.

The main objective of the Search engine ranking to determine where a URL appears on the list on searching into the web.

6 0
3 years ago
Other questions:
  • Use the image above to determine which toolbars will be displayed in the program you are using. SELECT ALL THAT APPLY
    11·2 answers
  • What does ADF means????
    13·2 answers
  • which virtue you need to secure information by limiting computer access to authorized personnel only?
    10·1 answer
  • A person who wants to buy a compact disc (cd) has just enough money to buy one, and chooses cd a instead of cd
    10·2 answers
  • During the _____ of the systems development life cycle (SDLC), an information system is operating, enhancements and modification
    9·1 answer
  • I'm gonna get grounded for getting a 52 on my test :(
    13·1 answer
  • The person responsible for setting goals and schedules, monitoring work, motivating the team, and reporting progress to managers
    7·1 answer
  • Witch factor will increase a populations size
    6·2 answers
  • Please its argent and I will give you BRAINLIEST ANSWER 6. How would you confirm that a colourless liquid given to you is pure w
    10·1 answer
  • Write a short note on Ms - Excel...​..
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!