Question: 6 . Given the following code fragment and the input value of 5 , what output is generated? ( 2 ) float tax; float total;

6.Given the following code fragment and the input value of 5, what output is generated? (2)
float tax; float total;
cout << "Enter the cost of the item
"; cin >> total;
if ( total >=5.0)
{
tax =0.14;
cout << total +(total * tax)<< endl;
}
else
{
cout << total << endl;
}
1.5
2.5.7
3.11
4.11.4
7.Given the following code fragment and the input value of 3.0, what output is generated? (2)
float tax; float total;
cout << "Enter the cost of the item
"; cin >> total;
if (total >3.0)
{
}
else
{
}
tax =0.10;
cout << total +(total * tax)<< endl;
1.3.0
2.2.0
3.3.3
4.2.3
8.If x has the value of 3, y has the value of -2, and w has the value of 10, is the following condition true or false?
(2)
if( x <2 && w < y)
1. true && true
true
2. false && false
false
3. false && false
true
4. true && false false

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!