Question

in c++ : i need three test cases, that test both mass & velocity. Already have...

in c++ :

i need three test cases, that test both mass & velocity. Already have written code.

mass

velocity

Expected Kinetic Energy

10

9

405

20

5

250

30

7

735

This is what I have, however I'm not sure how to properly write it so its testing both.

TEST_CASE("Verify Test Configuration", "verification") {

  REQUIRE(true == true);

}

TEST_CASE("test")

{

  REQUIRE(test_config() == true);

}

TEST_CASE(mass, velocity)

{

  REQUIRE(mass(10) && velocity(9) == 405);

}

TEST_CASE(mass, velocity)

{

  REQUIRE(mass(20) && velocity(5) == 250);

}

TEST_CASE(mass, velocity)

{

  REQUIRE(mass(30) && velocity(7) == 735);

}

Homework Answers

Answer #1

Greetings!!

Code:

#include <iostream>
using namespace std;
void test_case(int,int);
void require(int,int);
int main()
{
cout << "mass\tvelocity\tkinetic energy" << endl;
test_case(10,9);
test_case(20,5);
test_case(30,7);
return 0;
}
void test_case(int a, int b)
{
require(a,b);
}
void require(int a,int b)
{
cout << a << "\t";
cout << b << "\t\t";
cout << a*b*b/2 << endl;
}

Output screenshot:

Hope this helps

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
What would the pseudocode be for this? The code for this has already been answered. I...
What would the pseudocode be for this? The code for this has already been answered. I need the pseudocode. Credit card numbers typically consist of 13, 15, or 16 digits. For example, 4690 3582 1375 4657 is a hypothetical credit card number. The first digit designates the system. In (3.1.1), the first digit, 4, shows that the card would be a Visa card. The following digits specify other information such as the account number and bank number. (The precise meaning...
I need the actual code for this... I found a similar response but it was not...
I need the actual code for this... I found a similar response but it was not thorough enough. Problem Prerequisites: None Suppose that a scientist is doing some important research work that requires her to use rabbits in her experiments. She starts out with one adult male rabbit and one adult female rabbit. At the end of each month, a pair of adult rabbits produces one pair of offspring, a male and a female. These new offspring will take one...
1. Motion of an object depends on its velocity only. True False 2. A car with...
1. Motion of an object depends on its velocity only. True False 2. A car with a mass of 2500 kg is traveling at a speed of 30 m/s due east. Choose the most appropriate answer to its momentum. a. 30 m/s due east b. 30 m/s c. 75,000 kgm/s d. 75,000 kgm/s due east 3. A car is traveling at 70 mph and then is involved in an accident with a head-on collision into a very solid wall. As...
You have been hired to test whether the demand for a product that your client produces...
You have been hired to test whether the demand for a product that your client produces varies between two demographic markets – the Urban and Rural markets. As such, in each market, you run a short survey that gauges customers demand for your product and assigns them to one of three categories – (i) High (ii) Medium or (iii) Low. You survey 70 people in the “Urban” market and find that their demand falls into the following “buckets” High                32...
Topics Arrays Accessing Arrays Description Write a C++ program that will display a number of statistics...
Topics Arrays Accessing Arrays Description Write a C++ program that will display a number of statistics relating to data supplied by the user. The program will ask the user to enter the number of items making up the data. It will then ask the user to enter data items one by one. It will store the data items in a double array. Then it will perform a number of statistical operations on the data. Finally, it will display a report...
Python Blackjack Game Here are some special cases to consider. If the Dealer goes over 21,...
Python Blackjack Game Here are some special cases to consider. If the Dealer goes over 21, all players who are still standing win. But the players that are not standing have already lost. If the Dealer does not go over 21 but stands on say 19 points then all players having points greater than 19 win. All players having points less than 19 lose. All players having points equal to 19 tie. The program should stop asking to hit if...
IntList Lab Specifications You are required to come up with a single header file (IntList.h) that...
IntList Lab Specifications You are required to come up with a single header file (IntList.h) that declares and implements the IntNode class (just copy it exactly as it is below) as well as declares the IntList Class interface only. You are also required to come up with a separate implementation file (IntList.cpp) that implements the member functions of the IntList class. While developing your IntList class you must write your own test harness (within a file named main.cpp). Never implement...
I completed everything except for the last part. I know my answers are right because i...
I completed everything except for the last part. I know my answers are right because i double checked but i just dont know how to answer the last section. Problem 3-1 Schedule C (LO 3.1) Scott Butterfield is self-employed as a CPA. He uses the cash method of accounting, and his Social Security number is 644-47-7833. His principal business code is 541211. Scott's CPA practice is located at 678 Third Street, Riverside, CA 92860. Scott’s income statement for the year...
PLEASE ANSWER ASAP. PLEASE! QUESTION 20 Sean has two supervisors who both provide appraisals on Sean's...
PLEASE ANSWER ASAP. PLEASE! QUESTION 20 Sean has two supervisors who both provide appraisals on Sean's performance. On a scale of 1-5, both supervisors gave Sean a 4.2. It is likely that Sean's performance appraisal is __________. valid specific feasible reliable QUESTION 21 When a performance appraisal process is valid, what does that mean? It is feasible to use It is acceptable to all parties It is a factual measure; it measures the process that you want to measure It...
Program will allow anywhere between 1 and 6 players (inclusive). Here is what your output will...
Program will allow anywhere between 1 and 6 players (inclusive). Here is what your output will look like: Enter number of players: 2 Player 1: 7S 5D - 12 points Player 2: 4H JC - 14 points Dealer: 10D Player 1, do you want to hit? [y / n]: y Player 1: 7S 5D 8H - 20 points Player 1, do you want to hit? [y / n]: n Player 2, do you want to hit? [y / n]: y...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT