Task:
Tasks to complete:
------------------------------------------------------------------------------------------------------------------------------------------
given code:
------------------------------------------------------------------------------------------------------------------------------------------
main.cpp
#include
#include "rectangleType.h"
using namespace std;
// part e
int main()
{
rectangleType rectangle1(10, 5);
rectangleType rectangle2(8, 7);
rectangleType rectangle3;
rectangleType rectangle4;
cout << "rectangle1: " << rectangle1 <<
endl;
cout << "rectangle2: " << rectangle2 <<
endl;
rectangle3 = rectangle1 + rectangle2;
cout << "rectangle3: " << rectangle3 << endl;
rectangle4 = rectangle1 * rectangle2;
cout << "rectangle4: " << rectangle4 << endl;
if (rectangle1 > rectangle2)
cout << "Area...
NEED ASAP PLEASE HELP
Task:
---------------------------------------------------------------------------------------------------------------------------------
Tasks to complete:
----------------------------------------------------------------------------------------------------------------------------------------
given code:
-----------------------------------------------------------------------------------------------------------------------------------------------
main.cpp
#include <iostream>
#include <iomanip>
#include "fractionType.h"
using namespace std;
int main()
{
fractionType num1(5, 6);
fractionType num2;
fractionType num3;
cout << fixed;
cout << showpoint;
cout << setprecision(2);
cout << "Num1 = " << num1 << endl;
cout << "Num2 = " << num2 << endl;
cout << "Enter the fraction in the form a / b: ";
cin >> num2;
cout << endl;
cout <<...
4) What is the output if the input istom - Sawyer? #include <iostream> using namespace std; int main() { string playerName; cout << "Enter name"; cin >> playerName; cout << endl « playerName; return 0; } a. Tom - Sawyer b. Tom Sawyer c. Tom d. Sawyer 5) Which XXX generates "Adam is 30 years old." as the output? #include <iostream> using namespace std; int main() { string name = "Adam"; int age = 30; XXX return 0; } a....
C++
1.
A?B?C?D? which one is correct
2.
3A, 3B
#include<iostream> using namespace std; void swap0(int* ptri, int* ptr2) { int *temp; temp = ptr1; ptr1 = ptr2; ptr2 = temp; void swap1(int ptri, int ptr2){ int temp; temp = ptri; ptr1 = ptr2; ptr2 = temp; portion void swap2(int *&ptri, int *&ptr2){ int* temp; temp = ptr1; ptr1 = ptr2; ptr2 = temp; void swap3(int &ptri, int &ptr2) { int temp; temp = ptr1; ptr1 = ptr2; ptr2 =...
256 Chapter 4 Loops and Files Review Questions and Exercises Multiple Choice and True/False 1. What will the printin statement in the following program segment displays int x = 5; System.out.println(x++): b. 6 c. O d. None of these What will the printin statement in the following program segment display? int x = 5: System.out.println(+*x): a. 3 b. 6 C.O d. None of these 3. In the expression number++, the ++ operator is in what mode? a. prefix b. pretest...
Question 1 Given the following composite condition (a>=0 && b==3) || c>b Generate a set of test cases (just the input values for a, b, and c) that you need to have 100% MC/DC coverage. Question 2 Given the following fragment of code: int tent=0, x=92, num; cout<<"Guess the number :"; cin>>num; while ((tent<5)&&(num!=x)) { tent++; if (num>x) cout<<"Smaller\n"; else if (num cout<<"Bigger\n"; else cout<<”You won!\n” cout<<"Guess the number :"; cin>>num; } (1) Build the corresponding control flow graph. (2)...
Project 1 - Operator Overloading (FlashDrive 2.0) In C++, many of the keyboard symbols that are used between two variables can be given a new meaning. This feature is called operator overloading and it is one of the most popular C++ features. Any class can choose to provide a new meaning to a keyboard symbol. Not every keyboard letter is re-definable in this way, but many of the ones we have encountered so far are like +, -, *, /,...
c++ question 1. C++ string Class What does the output look like after executing the following statements? std::string numstr = "12"; numstr += "3"; std::cout << numstr << '\n'; A. None of these. B. The snippet has syntax errors. C. 15 D.123 // 2. Let S be a class that allows integers to be stored in its objects like an array. For example, if obj is an object of S, one can write statements like obj[0] = 100; or int...
Question 1 An array is NOT: A - Made up of different data types. B - Subscripted by integers. C - A consecutive group of memory chunks. D - None of the choices. Question 2 How many times is the body of the loop executed? int i=1; while(true) { cout << i; if(++i==5) break; } A - Forever B - 4 C - 5 D - 6 E - 0 Question 3 What is wrong with the following piece of...
C++ Questions Please answer quickly!
1.
Please use this info to answer next questions ->
2. Please give reasoning
4. Explain why, I think it is 4 but i also think it might be
0.
You need to write a program that uses the speed of light in a vacuum (299792458 meters per second) Realizing that this is a very large value, you run this code to see how large a value you can store as an int, a long...