Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Select the answer set that best matches the step-by-step order of operation and output of the code, There are partial marks available if the answer

Select the answer set that best matches the step-by-step order of operation and output of the code, There are partial marks available if the answer you select is partially correct.

#include int main(void) {

int numOranges = 0;

double costOranges = .67;

double weightBananas = 0.0;

double costBananas = .59;

double total = 0.0;

printf("Enter number of oranges: "); //user enters 2

scanf("%d", & numOranges);

printf("Enter weight of bananas: "); //user enters 3.4

scanf("%lf", & weightBananas);

total = costBananas * weightBananas + costOranges * numOranges

printf("Total is equal to: $%.2lf ", total); return 0; }

1.

numOranges instantiated with value 0 costOranges instantiated with value .67 weightBananas instantiated with value 0.0

costBananas instantiated with value .59

total instantiated with value 0.0 user prompted to enter number of oranges user entered value read from screen and stored in numOranges user prompted to enter weight of bananas user entered value read from screen and stored in weightBananas costBananas multiplied by weightBananas and added to the result of multiplying costOranges by numberOfOranges, the result of the calculation is assigned to total

Total is equal to: $3.35 is output to screen followed by a new line _____________________________________________________________________________

2

numOranges instantiated with value 0 costOranges instantiated with value .67 weightBananas instantiated with value 0.0

costBananas instantiated with value .59

total instantiated with value 0.0 user prompted to enter number of oranges user entered value read from screen and stored in numOranges user prompted to enter weight of bananas user entered value read from screen and stored in weightBananas costOranges multiplied by numOranges and promoted to double and added to the result of multiplying costBananas by weightBananas, the result of the calculation is assigned to total

Total is equal to: $3.35 is output to screen followed by a new line _____________________________________________________________________________

3.

numOranges instantiated with value 0 costOranges instantiated with value .67 weightBananas instantiated with value 0.0

costBananas instantiated with value .59

total instantiated with value 0.0 user entered value read from screen and stored in numOranges user entered value read from screen and stored in weightBananas costOranges multiplied by numOranges and promoted to double and added to the result of multiplying costBananas by weightBananas, the result of the calculation is assigned to total

Total is equal to: $3.35 is output to screen followed by a new line ______________________________________________________________________________

4.

user prompted to enter number of oranges

user entered value read from screen and stored in numOranges user prompted to enter weight of bananas user entered value read from screen and stored in weightBananas costOranges multiplied by numOranges and promoted to double and added to the result of multiplying costBananas by weightBananas, the result of the calculation is assigned to total

Total is equal to: $3.35 is output to screen followed by a new line ________________________________________________________________________________

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Visual C# And Databases

Authors: Philip Conrod, Lou Tylee

16th Edition

1951077083, 978-1951077082

More Books

Students also viewed these Databases questions