(a) ask the item price from the user (b) ask how many items to purchase for a specific item price (c) ask if there are other items to purchase, if yes, repeat the first step, proceed to the next step if otherwise (d) compute and display for the total amount to pay (e) ask for the payment from the user (f) accepts only enough amount of payment, ask another payment if otherwise (g) compute and display change
Q: Programming Requirements Write a C++ program that checks whether a date entered in the form of:…
A: Programming instructions: Include necessary header files. Declare the required variables for date,…
Q: Write a program in C to print a diamond using *. Ask the use to input the height of the pyramid.…
A: Please find the answer below :
Q: PROBLEM 2: Using user defined function and appropriate conditional and looping statements, create a…
A: The program is written in C++. Please find the source code in the below steps.
Q: Develop a C++ program to calculate the area, perimeter and diagonal of a rectangle. The program…
A: The program is written to call two functions from main. Depending on whether the user wants to draw…
Q: Use switch-case statements for this program. Write a menu-driven c program which has the following…
A: Switch Statement is a multiple is a multiple choice selection statement. It will be executed…
Q: Q1/ Use the structure Time to write a C++ program that inputs a time in hours, minutes and seconds…
A: #include<iostream> using namespace std; //Time Structure struct Time { int h,m,s; };…
Q: Create a program that computes for the value of an exponent using one function prototype,…
A: Algorithm to compute the value of an exponent: Function: compute_exponent(base, power) 1. Initialize…
Q: The program should have the following specifications: Declare variables x, y and z with ‘int’ data…
A: Our guidelines are binding us till first question only. Kindly post the remaining separately. -…
Q: 3. Using functions, develop a full C++ structured program that asks the user for his choics:1 or 2.…
A: Functions required:- convertToF() convertToC() Formula used f=(9/5)*c +32 Formula used…
Q: 1. Create a flowchart and C++ program of the following problem: The manager of a football stadium…
A: #include <iostream> using namespace std; int main(){ int pr,b,s,ga;…
Q: 1. Write a complete C++ program to prompt a user to enter the working hours and rate per hour.…
A: Given Total_salary=working hours* rate per hours To write c++ program to calculate total salary
Q: DO IT WITH C++ PROGRAM 1. Write a parameter and return program that will require the user to enter…
A:
Q: Question D. Write a C++ program that computes the factorial of a given positive integer (n!). The…
A: CPP program to compute the factorial of a given positive integer (n!). Prompt the user to enter the…
Q: Write a c++ program that prompts the user to enter the length and the width of a rectangle. The…
A: C++ is one of the most popular programming language developed by Stroustrup at Bell Labs. The basic…
Q: Code, compile and execute a C++ program that accepts the x and y coordinates of two points. The…
A: Read the value of x1 and x2 and the value of y1 and y2 . Find the value Xm and Ym by using the…
Q: Use a user defined function and appropriate conditional and looping statements to create a program…
A: Given: We are given the requirements to design the code. Goal: To write code to achieve the given…
Q: c) How can you write a C++ program to read input two numbers p,q and then display the maximum value…
A: Write a C++ program to read input two numbers p,q and then display the maximum value of p and q in…
Q: Q3. Using the user-defined function term, develop a C++ program that finds the value (N^10), where…
A: I am writing this program in c++ program
Q: 3. Using functions, develop a full C++ structured program that asks the user for his choics:1 or 2.…
A: The given problem is to be solved in C++ language where the conversion of the temprature will be…
Q: 1- write a c program to process weekly employee time cards for all employees of an organization…
A: As per the guidelines we are supposed to answer only one question. Kindly repost other questions as…
Q: Write a complete C program to calculate the perimeter and area of a triangle with 3 sides namely a,…
A: PROGRAM: //Header files #include <stdio.h> #include <string.h> #include <math.h>…
Q: user-defined function and appropriate conditional and looping statements, create a program using C++…
A: Explanation: Detail Code #include <bits/stdc++.h>using namespace std; int main(){ int…
Q: Write a program to find the product of 2 power numbers if the base and the exponent of these numbers…
A: C++ Program for above : #include <iostream> #include <math.h> using namespace std;…
Q: Use a user defined function and appropriate conditional and looping statements to create a program…
A: NOTE: since you have not mentioned your preferred programming language, I am attempting this in…
Q: A management firm has 100 employees in total. The management firm increases the salary of the…
A: I have provided C++ CODE along with SCREENSHOT OF CODE WITH OUTPUT---------
Q: Develop a C++ program to calculate the area, perimeter and diagonal of a rectangle. The program…
A: Given length and width, the program need to calculate area,perimeter and diagonal. Based on the user…
Q: Create a program using c++ compiler that will display the nth numbers in the Fibonacci series. The…
A: Objective: This program receives the value of the length of the Fibonacci series and prints values…
Q: Write a complete c++ program. In the main function, do the following: Take two integer numbers…
A: #include <iostream>using namespace std; // Function to swap 2 integersvoid swap(int *n1, int…
Q: Write a C++ program to display the table given below. Use manipulator functions. You need to…
A: Percent means per cent (hundreds), i.e., a ratio of the parts out of 100. The symbol of percent is…
Q: As a programmer, you are asked to develop a C program using if...else statements or switch…
A:
Q: Using user defined function and appropriate conditional and looping statements, create a program…
A: CODE:- #include<iostream>using namespace std;int payment(int tot){ int paym; do{…
Q: Write a C++ program that prompts the user to enter two integer numbers and the program should print…
A: According to the Question below the program: Program Output:
Q: 3. Write a C program which will take two real numbers and a character from the keyboard. a. The…
A: #include <stdio.h> int main(){ float num1, num2; char op; printf("Enter operator: ");…
Q: Write a C++ program that prompts the user to enter two integer numbers and the program should print…
A: The code and the output has been given in step 2.
Q: B. Your Computer Science assigned a task to you. Your task is to develop a C program to read a…
A: As per the company guidelines we are supposed to answer only one question. Algorithm Step 1: Start…
Q: PROBLEM: Write a C++ Program to solve the following using functions: a. Convert Binary Number to…
A: The numbers are represented in various number systems using the base of the number, if the base is 2…
Q: Design, write and compile, and run a C++ program to convert temperature in degrees Fahrenheit to…
A: Write a program using C++ language which takes an input(temperature in fahrenheit) and convert it…
Q: Create a c program that evaluates a quadratic function x^2 +5x +6. The main program will call a…
A: Program description: The main.c C program objective is a prompt user to enter the x value. Then the…
Q: The spring force, Fs of a deformed spring is defined as follows: Fs = K|L2 - L1| where K is the…
A: fabs function is used to find the positive difference of 2 float numbers
Q: Using functions, write and submit the source codes that will solve the given problems. PROBLEM 1:…
A: code: #include<iostream>using namespace std; int fiboseries(int num);int fiboseries(int num){…
Q: I need help writing a C++ program. I need a function name celsius that accepts a Fahrenheit…
A: Program: Programs are used to interact with the computer and solve problems according to the…
Q: Assuming a frictionless environment, the velocity of an object, v, that is released from a…
A: Here I have created the function named velocity(). In this function, I have calculated the velocity…
Q: Write a complete C program to calculate the perimeter and area of a triangle with 3 sides namely a,…
A: The following C code has five functions. They are: void menu() - This function is to print the…
Q: Develop a C++ program to calculate the area, perimeter and diagonal of a rectangle. The program…
A: PROGRAM CODE: #include <iostream> // include header file for input output…
Q: Exercise 1: Write a C program to calculate the perimeter and area of a rectangle by using two…
A: As we know that; Area of rectangle = length* width Perimeter of rectangle = 2 (length + width)
Q: 1. Problem: write a complete program to calculate the total price of an item by asking the user to…
A: #include <iostream> using namespace std; int main(){ double price; int quantity;…
Using user defined function and appropriate conditional and looping statements, create a program using c++ compiler that will:
(a) ask the item price from the user
(b) ask how many items to purchase for a specific item price
(c) ask if there are other items to purchase, if yes, repeat the first step, proceed to the next step if otherwise
(d) compute and display for the total amount to pay
(e) ask for the payment from the user
(f) accepts only enough amount of payment, ask another payment if otherwise
(g) compute and display change
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images
- (Data processing) Years that are evenly divisible by 400 or are evenly divisible by 4 but not by 100 are leap years. For example, because 1600 is evenly divisible by 400, 1600 was a leap year. Similarly, because 1988 is evenly divisible by 4 but not by 100, it was also a leap year. Using this information, write a C++ program that accepts the year as user input, determines whether the year is a leap year, and displays a message telling the user whether the entered year is or is not a leap year.(Civil eng.) Write a C++ program to calculate and display the maximum bending moment, M, of a beam that’s supported on both ends (see Figure 3.8). The formula is M=XW(LX)/L, where X is the distance from the end of the beam that a weight, W, is placed, and L is the beam’s length. You program should produce this display: The maximum bending moment is xxxx.xxxx The xxxx.xxxx denotes placing the calculated value in a field wide enough for four places to the right and left of the decimal point. For your program, assign the values1.2,1.3,and11.2toX,W,andL.Using the user-defined function and appropriate conditional and looping statements, create a program using C++ language that will: (a) ask the item price from the user (b) ask how many items to purchase for a specific item price (c) ask if there are other items to purchase, if yes, repeat the first step, proceed to the next step if otherwise (d) compute and display for the total amount to pay (e) ask for the payment from the user (f) accepts only enough amount of payment, ask another payment if otherwise (g) compute and display change
- Using user defined function and appropriate conditional and looping statements, create a program that will: (a) ask the item price from the user (b) ask how many items to purchase for a specific item price (c) ask if there are other items to purchase, if yes, repeat the first step, proceed to the next step if otherwise (d) compute and display for the total amount to pay (e) ask for the payment from the user (f) accepts only enough amount of payment, ask another payment if otherwise (g) compute and display changeUse C++ Programing language. Write a program that computes and displays the charges for a patient’s hospital stay. First, the program should ask if the patient was admitted as an inpatient or an outpatient. If the patient was an inpatient, the following data should be entered: The number of days spent in the hospital The daily rate Charges for hospital services (lab tests, etc.) Hospital medication charges If the patient was an outpatient, the following data should be entered: Charges for hospital services (lab tests, etc.) Hospital medication charges Use a single, separate function to validate that no input is less than zero. If it is, it should be reentered before being returned. Once the required data has been input and validated, the program should use two overloaded functions to calculate the total charges. One of the functions should accept arguments for the inpatient data, while the other function accepts arguments for outpatient data. Both functions should return the…C PROGRAMWrite a c program FUNCTION that displays the corresponding day of the week given a valid date. For each valid date input the user enters, the program should immediately display the corresponding day of the week. The program ends only when an invalid input is entered by the user.Input: The expected date input will be in the format day month year. The accepted possible values of day will be from the range 1 to 31. The accepted possible values of month will be from the range 1 to 12. As for the possible values of year, the range is already specified. A valid date input is a correct calendar date. Output: The output day of the week will be the correct one of the days of the week: Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, or Sunday. The program should follow this input-output interface format (example):(Input) Enter date: 30 12 2021 (dd mm yy format)(Output) Day: Thursday Take note:Your solution will be using the following algorithms concerning dates: ● An algorithm…
- Using c++ write a program : Write a C++ program to calculate net pay of an employee. Input basic pay from user, and pass it to a user defined function CalculatePay(), calculate the net pay and return to main function. Calculate net pay of employee: House Rent is 35% of basic salary Medical Allowance is 10% if basic pay is more than Rs. 10000/-. It is 15%, if basic pay is less than or equal to Rs. 10000/- Conveyance allowance is Rs. 1000/- if basic pay is less than or equal to Rs. 10000/-. It is Rs. 1800/- if basic pay is more than to Rs. 10000/- Net pay is calculated by adding basic pay, house rent, medical allowance and conveyance allowance.Programming Exercise C++ Instructions : Write a program that outputs inflation rates for two successive years and whether the inflation is increasing or decreasing. Ask the user to input the current price of an item and its price one year and two years ago. To calculate the inflation rate for a year, subtract the price of the item for that year from the price of the item one year ago and then divide the result by the price a year ago. Your program must contain at least the following functions: a function to get the input; a function to calculate the results; a function to output the results. Use appropriate parameters to pass the information in and out of the function. An example of the program output is shown below: Enter the current price of the item: 10 Enter the price of the item one year ago: 8 Enter the price of the item two years ago: 4 Current year inflation: 0.25 Inflation one year ago: 1.00 Inflation is not increasing. Since your program handles currency, make sure to…C++ with multiple functions if possible Write a program to simulate an automated teller machine (ATM) at a bank. The program should ask the user for a four-digit personal identification number (PIN) to verify they are supposed to have access to the account. If they enter the PIN incorrectly, they should be denied access to the account, but the program should automatically ask them to enter the PIN again. It is up to you to decide if you want to give a maximum number of tries before exiting. The ATM program should ask the user for a beginning balance, and then provide the user with the opportunity to enter deposits and withdrawals until the user wishes to exit the program. Upon exiting the program, it needs to display the current balance.
- PROBLEM 2: Using user defined function and appropriate conditional and looping statements, create a program that will: (a) ask the item price from the user (b) ask how many items to purchase for a specific item price (c) ask if there are other items to purchase, if yes, repeat the first step, proceed to the next step if otherwise (d) compute and display for the total amount to pay (e) ask for the payment from the user (f) accepts only enough amount of payment, ask another payment if otherwise (g) compute and display changeHUK computer store offers credit plan at 10% down payment and an annual interest rate of 12%. You are required to write a C++ program to calculate and print the payment schedule for a loan to purchase a computer for the first month: a. Prompt the user for the purchase b. Write a void function called display() to print the following headings: The month number The starting balance The interest to pay The principal to pay The monthly payment The ending balance for that month c. Create a double function called creditcredit() that has the purchase price as its parameter. The function must do the following (d to j): d. Create two variables annual interest rate = 12% monthly rate = annual interest rate/12 e. The month number should begin with 1 f. Use a loop to display information for 12 months g. Monthly payment is calculated at 5% of the purchase h. The amount of interest for a month is calculated as the…Question 1: Answer the following questions (a) Produce a Pseudocode and a C++ program for a number guessing game. Your program is required to guess what a number a computer has in mind (generate number using built-in Random function) between 0 - 100. The Program prompts the user to enter a number continuously until the number match with random generated number. For each input, the program tells the users whether the input is too low or too high. So, the user can choose the next input intelligently. Sample output is as below. Guess a magic Number between 0 to 100. (Random number 8) Enter your Guess: 50 Your Guess is too High Enter your Guess: 25 Your Guess is too High Enter your Guess: 12 Your Guess is too High Enter your Guess: 6 Your Guess is too Low Enter your Guess: 9 Your Guess is too High Enter your Guess: 7 Your Guess is too Low Enter your Guess: 8 Yes, you guessed the right number 8