can you help me to correct this 1. Write a program that accepts from the user a unit price of a certain product and the quantity of that product bought by a customer. It should compute and display the amount payable. #include int main (){ float unitPrice, amount; int quantity; printf("Enter the unit price of a product: "); scanf(unitPrice); printf("Enter the quantity of that product: "); scanf(quantity); amount = unitPrice * quantity; prinf("Amount Payable: "amount); return 0; }
Q: #include int main() float Bread = 1.09, Water = 2.18, Banana = 1.00, Meat = 7.99; // Unit for bread…
A: Solution: These two line are: //line-1 printf("You have %d loaves of bread, %d bottles of…
Q: I ned help programming this C++ program: Write a C++ console application that calculates and…
A: C++ Code: #include <iostream>using namespace std; float calculateCharges(int hours) { //…
Q: - Write a program that takes a first name as the input, and outputs a welcome message to that name.
A: I have done the code using C language.
Q: When passing any of the following data types to a function that doesn’t need to change the…
A: the best method for that call by value and call by reference is an array of integers 2.An array of…
Q: using System; using System.Linq; using System.Text; namespace Games; { class Program { staticvoid…
A: GIVEN: using System; using System.Linq; using System.Text; namespace Games; { class Program {…
Q: You need to store hiring date and date of birth for teachers, and for students store their admission…
A: Composition: Composition in C++- In real life, complex structures are often constructed from…
Q: main (void) void qst (float a, float b, int "y) float a = 3.0, b = 2.0; int y -6; %3D int x - 4, w-…
A: C program used to answer this question
Q: def main(): monthlySales = getSales() printbonus=print_bonus(storeAmount,empAmount) #This…
A: Coded using Python 3.
Q: Write a program that reads from an input file, given by a user, students grade information after a…
A: Provide API documentation comments for your class(es), class constructor(s) and method(s) using the…
Q: Write a program that computes and assesse the tuition fee of the students in one semester, based on…
A: Algorithm: 1. Start. 2. Read the tuition fee as tuition_fee. 3. Read payment mode (Press (1) - Cash,…
Q: In a course with 2 midterms and 1 final exam, you will write a code that determines the remainder…
A: #include <stdio.h> int main(){ float first, second, final; float avg; printf("\n…
Q: #include int k=0; int f(int t) { k += t; heturn k; } void main() int i, result=1; { for(i = 1;i <=…
A: Hello student Greetings Hope you are doing great. I will try my best to answer your question. Thank…
Q: For each function prototype, find the valid return statement. int MyFunction(char r, int a); A.…
A: The prototype of functions is given, find the valid return type of function from the given return…
Q: include void fun1(int num, ...); void fun2(int num, ...); int main() { fun1(1, "Apple", "Boys",…
A: Explanation: The code defines two functions, fun1 and fun2, which have variable arguments. In the…
Q: Q1. The circle has two data members, a Point representing the center of the circle and a float…
A:
Q: main () { int x, y, z,M; x=0; y=1;z=1; M=++x || ++y && ++z; cout<<"M="<<M; }
A: { Int x, y, z ,M X=0; y=1;z=1; M=++x || ++y && ++z; Cout << “M=”<<M; }
Q: Write a program that gets two car information from the user, compares them, and print out the…
A: First, we need to define Car class with the attributes and methods and then define the main function…
Q: Decision Structure Problem For this assignment you will do 2 things: Solve the problem with…
A: Actually, pseudocode is an artificial and informal language that helps programmers develop…
Q: Assignment Write a program that tracks how much steps the user walks in total in a day and reports…
A: Solution: Solution in c++
Q: displays all of their favorite food dishes as shown: */ let person3 = { pizza:["Deep Dish","South…
A: I have done the code using Javascript
Q: #include #include void fun1(int num, ...); void fun2(int num, ...); int main() { fun1(1, "Apple",…
A: Include the necessary header files: stdio.h for input/output operations and stdarg.h for handling…
Q: max = value2; %3D int main () int max = 03; %3D maxValue (1, 2, тах); cout << "max is " << max <<…
A:
Q: roduct sold by the juice machine. 2. Let the customer make the selection. 3. Show the customer the…
A: Q. Fruit Juice MachineIn this programming example, there are one function available which is main()…
Q: For the C++ program show on the next page, answer the questions that follow. The names g, j, x, and…
A: in line 12,13 ,14 variable f and x is in local scope and variable g is in global scope. in point A…
Q: Functions Exercise (Parking Charges) A parking garage charges a $2.00 minimum fee to park for one…
A: Source Code :-#include <iostream>#include <iomanip> using namespace std; /** * Creating…
Q: Which line is the calling of function Max?
A: Q: Answer the given question
Q: uble* y3): For given three 2D points A(x1,y1), unter-clockwise and return them in the correct ath.h…
A: #include<stdio.h> #include<graphics.h> #include<math.h> int main() {…
Q: Problem #1 Problem #5 Revisit the MixColors # Take your answer from Week 3 Wednesday for the…
A: Start the program.Define a function named "mixColors" that takes two parameters, "color1" and…
Q: Exercise #1: Write a program that prompts the user to input the total number of students that plan…
A: Your C++ program is given below with an output.
Q: Static Variable: a variable whose lifetime is the lifetime of the program (static int x;) Dynamic…
A: Given: Static Variable: a variable whose lifetime is the lifetime of the program (static int x;)…
Q: Write a test program that would take at least 3 combinations of amounts entered and choices of…
A:
Q: Group Project In Java (Airline System) A small airline has just purchased a computer for its new…
A: Java Code: FlightDetails.java package com.bb; public class FlightDetails extends FlightExtraDetails…
Q: A Gas Station • You have been asked to create a C program to manage the gas pumps at a gas station.…
A: Here's the algorithm in steps for the given C program:Initialize Tank Capacities:Define the number…
Q: Write a program that asks the user to enter five test scores. The program should display a letter…
A: Introduction This programming problem requires writing a C++ program that takes in five test scores…
Q: Create two integer variables: x and y. Print if those variables are in following conditions: • r €…
A: Actually, java is a object oriented programming language. It is a platform independent.
Q: In India McDonald's has the n number of customers and they are famous for their taste and quality so…
A: Given: - The solution as per the given information
Q: A program contains the following function. int cube(int num) {return num * num * num; }Write a…
A: Function Call The function accepts a number of type int as a parameter and returns the cube value of…
Q: main(){ float y3D20.3; int x-20; float z; z=x+y; cout<<z;} 40.3 O 20 40
A: The corrected option is 40.3
Q: The following function has errors. Locate as many errors as you can. void getValue(int value&) {…
A: GIVEN: The following function has errors. Locate as many errors as you can. void getValue(int…
can you help me to correct this
1. Write a
#include <stdio.h>
int main (){
float unitPrice, amount;
int quantity;
printf("Enter the unit price of a product: ");
scanf(unitPrice);
printf("Enter the quantity of that product: ");
scanf(quantity);
amount = unitPrice * quantity;
prinf("Amount Payable: "amount);
return 0;
}
Step by step
Solved in 3 steps with 2 images
- In C++ A Paint Company has asked you to write an application that calculates the quantity and price of Paint required to a paint for rectangular rooms in a building. To calculate the quantity of paint required, you have to first calculate area of room, assuming one gallon is enough for 120 square feet.Then for price you multiply the quantity of paint by the price per gallon. For example, the area of room that is 34 square feet. To cover that room with paint that costs 1000 per gallon would cost (1/120*34=2.83 gallon, 2.83*1000=2833rs).(you can take help from internet for exact formulas)First, you should create a class named RoomDimension that has two attributes: one for the length of the room and one for the width. The RoomDimension class should have a member function that returns the area of the room. Once you have written the class, use them in an application that asks the user to first enter total number of rooms, create a dynamic array, then ask user to enter the dimensions of a…The function below does not work as expected: If sales is a negative number is returns 3 instead of returning 0. Please help me correct it. /*This function determines the commision percent based on the following table:Sales Commission$0 - 1000 3%1001 - 5000 4.5%5001 - 10,000 5.25%over 10,000 6%*/double Sales::detCommissionPercent() const{double commission = 0;if ( amountSold > 0){if(amountSold<= 1000) // if amountSold is between [0, 1000] commission = 3;else if(amountSold<=5000)// if amountSold is between [1001, 5000] commission = 4.5;else if(amountSold<=10000) // if amountSold is between [5001, 10000] commission = 5.25;else commission = 6;}return commission;}There may be more than one correct answer. You must give all correct answers for full credit. An explanation is required. Consider the function void doStuff (int parValue, int& parRef) { } parValue = 100; cout << "parValue in call to doStuff = << parValue << endl; parRef = 222; cout << "parRef in call to doStuff = << parRef << endl; and consider the call, which we assume is in a complete and correct program int n1 = 1, n2 =2; doStuff (n1, n2); The call to dostuff results in the assignment n1 = 222; The call to dostuff results in the assignment n2 = 222; The call to doStuff results in the assignment n1 = 100; The call to dostuff results in the assignment n2 = 100; There is no effect on either of these variables. C++
- X3: inlTo10 Write a function in Java that implements the following logic: Given a number n, return true if n is in the range 1..10, inclusive. Unless "outsideMode" is true, in which case return true if the number is less or equal to 1, or greater or equal to 10.be recor #include #include minutes #include limit on int func(int, int, int, int); main(){ srand(time(NULL)); int a, b, c, fNum; printf("Choose three different numbers between 0-39:"); scanf ("%d%d%d", &a, &b, &c); fNum = func (a, b, c, 25); printf("\nThe result: %d", fNum); } int func (int ul, int u2, int u3, int iter){ srand (time (NULL)); int n1=0, i=0, count=0; for (;iint x1 = 66; int y1 = 39; int d; _asm { } mov EAX, X1; mov EBX, y1; push EAX; push EBX; pop ECX mov d, ECX; What is d in decimal format?Transcribed Image Text Write a program that asks for the principal, the annual interest rate, and the number of times the interest is compounded. It should display a report similar to the following: Interest Rate: 4.25% Times Compounded: 12 Principal: $ 1000.00 Interest: 43.33 Final balance: $ 1043.33Complete function PrintPopcornTime(), with int parameter bagOunces, and void return type. If bagOunces is less than 3, print "Too small". If greater than 10, print "Too large". Otherwise, compute and print 6* bagOunces followed by seconds". End with a newline. Example output for ounces = 7: 42 seconds 1 #include NM & in 107 2 3 void PrintPopcornTime (int bagOunces) { 4 requiriturgy 5 /* Your solution goes here */ 6 7} 8 9 int main(void) { 10 int userOunces; 11 12 scanf("%d", &userOunces); 13 14 15 16} PrintPopcornTime (userOunces); return 0;Using c++Recommended textbooks for youDatabase System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSONC How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag…Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill EducationDatabase System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSONC How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag…Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education