63 067
Assignments Done
99,1%
Successfully Done
In July 2018

Answer to Question #34321 in C++ for jay

Question #34321
Create a C function that will accept “Quantity of items”, “Price per quantity”, “Cash of the buyer” and display the “Change and Amount Rendered”. Display a message whether the transaction is successful or not.
Expert's answer
#include <stdio.h>
#include <iostream>


using namespace std;


void func()
{
cout << "Quantity of items: ";
int n = 0;
cin >> n;


cout << "Price per quantity: ";
double p = 0.0;
cin >> p;


cout << "Cash of the buyer: ";
double c = 0.0;
cin >> c;


cout << endl << "Change and Amount Rendered." << endl << endl;


if (n*p <= c) cout << "Your transaction is successful.";
else cout << "Your transaction is not successful.";
}


int main()
{
func();
cin.get();
cin.get();
return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions