Programming C Create a program that tells you how much money you have left after buying furniture for your home. In main, ask for the initial amount of money. Then, send this value to function home. In function home, ask the user repeatedly for the expenses. Keep asking until the user inputs zero. When done, also in function home, print out the result (the money that the user has left). Output: How much money do you have? 20000.00 List the prices of the thing you just bought: 355.54 45.54 109.45 32.55 839.32 599.99 The money you have left: 18017.61
Q: in C++ Write a program to call two functions: 1. Sum four integer numbers 2. calculate the averages…
A: Actually, program is an executable software that runs on a computer.
Q: You must answer the Problem in C++. (Anagrams) Write a function that checks whether two words are…
A: #include <iostream> #include <string> using namespace std; bool isAnagram(const string…
Q: Write a program, USING C, to read and display the information employees in a group. Then edit the…
A: Given: Write a program, USING C, to read and display the information employees in a group. Then…
Q: Write a C program that plays the game of "guess the number" as follows: Your program chooses the…
A: in order to generate random number in C programming language we are going to use the rand() function…
Q: write a program in c++. You work for a box company, and have been asked to write a program to…
A: PROGRAM INSTRUCTIONS: The C++ program has the following algorithm: Declare and initialize the…
Q: Q4, a mechanical pump whose rated speed is (Sm=15 cfm) is connected by a pipe and valve to a vacuum…
A: Please refer to the following steps for the complete solution to the problem above.
Q: In C++ just do the problems in simple, not complicated code. Even if a problem does not directly…
A: Program Screenshot: Output Screenshot: Program: #include <iostream> using namespace…
Q: In c++, create a program that gets quarterly sales from a user and calculates the total of all four…
A: Introduction: Here we are required to display the total, average, highest and lowest quarter sales…
Q: Here are my Instructions for my C++ Program Exercise Write a program that accepts as input: 1. The…
A: The below C++ program will obey the following rubrics: Including necessary header files. Declaring…
Q: Write a programme in C where you may get: i) The summation of all individual digits/symbols of your…
A: #include <stdio.h> int main(void) { int id,sum=0,mul=1,temp; printf("Enter your id");…
Q: Part1: • Write a program that presents to the users a choice of your 4 favorite beverages (Water,…
A: Here in this question we will be writing program which will simply ask user to enter his choice for…
Q: Write a C program that plays the game of "guess the number" as follows: Your program chooses the…
A: Actually, program is a executable software that runs on a computer.
Q: hat generates a random number in range between 1 to 10
A: In C++ rand() is an inbuilt function to generate random numbers included in the standard library of…
Q: The problem is from Introduction to Programming and Data Structures with C++, 4th edition (Count…
A: #include <iostream> using namespace std; int main() { int num, pos = 0, neg = 0,counter =…
Q: Write a C++ function: int rectArea (int len, int wid) that returns the area of a rectangle with…
A: Algorithm 1. Start 2. Var Len, wid, area 3. Accept len and wid from user 4. Area=rectArea (len, wid)…
Q: This is a C program. I want you to convert it to a C++ program. Also provide a screenshot that it is…
A: Here, I have to convert C code to C++ code for the above one.
Q: FOR C++ PROGRAM, PLEASE WRITE THE CODE IN 15 MINUTES ! Write a function that draws a square as…
A: PROGRAM INTRODUCTION: Include the required header files. In the definition of the main function,…
Q: The members of the board of a small university are considering voting for a pay increase for their…
A: Algorithm : Step 1 : declare arrays. Step 2 : declare variables. Step 3 : use for loop to ask for…
Q: Write a C program: The use of computers in education is referred to as computer-assisted instruction…
A: Program approach – Include the essential header files. Declare the variables. Define the function…
Q: Write a program in C++ which adds, subtracts, multiplies, divides, and perform exponentiation on two…
A: Algorithm: Start Select the operation to be performed Read two numbers a,b If user selected…
Q: 40. Write a program in C++ that reads ten names then ask user to enter name then print the number of…
A: Coded in C++.
Q: write a program in c++. You work for a box company, and have been asked to write a program to…
A: Below is the required C++ program. Program Approach: Include necessary header files and using the…
Q: I want to solve the question in c++ Exercise 5 Part1: • Write a program that presents to the…
A: Find the required code given as below and output :
Q: In C++ Write a program with a car's miles/gallon and gas dollars/gallon (both doubles) as input, and…
A: Here I have taken input from the user. Then I have calculated the cost in dollars for 20, 75, and…
Q: write a program in c++. You work for a box company, and have been asked to write a program to…
A:
Q: In C++ 1. Write a program that accepts from the user an amount in Peso. It should compute the…
A: Given: The amount entered by the user in Peso. Also, 1 HK dollar = Php 6.51 1 US dollar = Php…
Q: Write a C program that asks the user to enter an iPhone 6 wholesale cost and its markup percentage.…
A: #include <stdio.h> double retailPrice(double wholesalePrice, double markupPercentage){…
Q: Write a C++ program to automate the Grocery shop bill for 6 items. The program asks grocery shop…
A: In step 2, you will get C++ code. In step 3, you can see the sample output.
Q: Exercise #2: Write a C++ program that computes a ride you took in taxi. The bill computed based on…
A: Step 1 : Start Step 2 : In the main function , declare the variables to store the input distance ,…
Q: Write a complete C++ program that calculate a patient's treatment charge based on the types of…
A: C++ code: #include <iostream>using namespace std; float calculate_discount_charge(float a){…
Q: Question 2: Write a program in C+ that calculates the total grade of a student for N number of…
A: Program Plan: Include header files Use namespace std; Define the main function Input number of…
Q: Write a C++ program to calculate a rectangle's area. The program consists of the following function:…
A: Step-1: Start Step-2: Declare variables length, width, area Step-3: Call function getLength and…
Q: IN C++ Test it in the main function Create e musicplayer with 3 songs. Play the current song. Play…
A: There are three parts: 1- Write a class(new type) to define the Song type. 2- Implement the…
Q: 2:Write a program in C# Sharp to calculate and print the Electricity bill of a given customer. The…
A: Programming instructions: Create required variables. Take input from the user for id , name and…
Q: 2. Write a C++ program to play a guessing game: • The computer randomly generates a number between 1…
A: // Code #include <iostream>#include <stdlib.h> using namespace std; int main(){ int…
Q: The ask_number() function in Python in the tic-tac-toe program will A. Ask for any number any a…
A: 1) Here is how ask_number function defined in tic-tac-toe program, def ask_number(question, low,…
Q: 4. Write a complete C++ program to calculate the wages of employees which are based on the number of…
A: we are using do while loop here, since in do while the condition is checked after the execution of…
Q: In C++ write a program that generates three random numbers and then find the min number among the…
A: void getrandnum(int &n1, int &n2, int &n3) { srand(time(0)); n1 = rand(); n2 = rand();…
Q: Write a program in python with a function repeatPhrase(phrase, n), which prints the given phrase n…
A: here in this question we have to write a program in python which take any string and integer n from…
Q: Write a program in C++ which adds, subtracts, multiplies, divides and perform exponentiation on two…
A: Required: Write a program in C++ which adds, subtracts, multiplies, divides and perform…
Q: Write a C++ program that caleulates the average score from a given list of positive integers (0-100)…
A: According to the question we have to write C++ code for the following program in which the class…
Q: Program in C: Create a program that tells you how much money you have left after some expenses. Use…
A: Program: //include the header file #include <stdio.h> //definition of "aaa" function int aaa…
Q: Write a program that will read an executive's job number, level number, and basic pay and then…
A: #define CA1 1000#define CA2 750#define CA3 500#define CA4 250#define EA1 500#define EA2 200#define…
Q: Write a function, which receives 5 integers and returns the sum, average and standard deviation of…
A: C program below is made to calculate the sum, average and standard deviation of 5 numbers. To…
Q: In C++ Write a program whose input is a character and a string, and whose output indicates the…
A: #include<iostream>#include<string> using namespace std; // function to print number of…
Q: Write a function solution that, given an integer N, returns the smallest number with the same number…
A: 1.Start 2.Declare variable N of integer data type 3.Take input for variable N 4.Call function…
Q: Write a C++ program that calculates the area of a rectangle. The main function asks the user to…
A: Area of the rectangle using c++ program
C program to show how much money you have left after buying furniture for your home.
Create a variable to store the initial Amount.
prompt the user to enter the initial Amount. Store the initial amount in the variable.
Call the function named home with the initial Amount.
In the function,
Create a variable to store the expenses.
prompt the user to enter the expenses.
Using the while loop gets the expense amount from the user until the user enters 0.
Store the expenses in the variable.
Subtract the expenses from the initial amount.
Display the money left after the expenses.
Step by step
Solved in 2 steps with 1 images
- Write a program in C language to simulate tossing a “fair” coin. Allow the user to enter the number of tosses.Print the number of tosses that yield heads and the number of tosses that yield tails.What should be the percentage distribution of heads and tails? (Use the function rand_int)Python programming In a department store sale, customers who purchase over 2000 are given 10% discount. Write a program that will accept for the purchase amount of a customer, solve for his/her discount if there’s any, ask for the money he/she is going to pay, then output the discounted price and the change of the customer.”Solve in Python: Write a program that creates a login name for a user, given the user's first name, last name, and a four-digit integer as input. Output the login name, which is made up of the first five letters of the last name, followed by the first letter of the first name, and then the last two digits of the number (use the % operator). If the last name has less than five letters, then use all letters of the last name. Ex: If the input is: Michael Jordan 1991 the output is: Your login name: JordaM91 Ex: If the input is: Kanye West 2024 the output is: Your login name: WestK24
- This is for Coral. Sites like Zillow get input about house prices from a database and provide nice summaries for readers. Write a program with two inputs, current price and last month's price (both integers). Then, output a summary listing the price, the change since last month, and the estimated monthly mortgage computed as (currentPrice * 0.045) / 12. Output the estimated monthly mortgage (estMortgage) with two digits after the decimal point, which can be achieved as follows:Put estMortgage to output with 2 decimal places Ex: If the input is: 200000 210000 the output is: This house is $200000. The change is $-10000 since last month. The estimated monthly mortgage is $750.00. Note: Getting the precise spacing, punctuation, and newlines exactly right is a key point of this assignment. Such precision is an important part of programming. The code I have written is: integer currentPriceinteger lastMonthsPriceinteger changeSinceLastMonthinteger estMortgage currentPrice = Get next…. Write a c++ program that tells what coins to give out for any amount of change from 1 cent to 99 cents. For example, if the amount is 86 cents, the output would be something like the following: 86 cents can be given as 3 quarter(s) 1 dime(s) and 1 penny(pennies) Use coin denominations of 25 cents (quarters), 10 cents (dimes), and 1 cent (pennies). Do not use nickel and half-dollar coins. Your program will use the following function (among others): void computeCoin(int coinValue, int& number, int& amountLeft); Note that: 0 < coinValue < 100; 0 <= amountLeft < 100. For example, suppose the value of the variable amountLeft is 86. Then, after the following call, the value of number will be 3 and the value of amountLeft will be 11 (because if you take three quarters from 86 cents, that leaves 11 cents): computeCoins(25, number, amountLeft); Write a driver program to test your function. Include a loop that lets…Write a program that creates a login name for a user, given the user's first name, last name, and a four-digit integer as input. Output the login name, which is made up of the first five letters of the last name, followed by the first letter of the first name, and then the last two digits of the number (use the % operator). If the last name has less than five letters, then use all letters of the last name. Hint: Use the to_string() function to convert numerical data to a string.
- Write a program that deals a number of cards (their numerical values) to a player's hand. To begin, the program asks the player for the values of the deck of cards. Then, the program deals the first two cards of the deck to a player's hand, and asks him if he wants another card. If he does not want a card, the program ends. If he wants a card, the program deals the next available card in the deck, adds it to the player's hand, and asks the player if he wants another card. The dealing process repeats as long as the user continues to accept cards, or until the cards in the deck run out. Card dealing involves copying the available card from the deck vector to another vector, which stores the player's hand, at the next available position. Assume that the deck of cards consists of only 10 cards with numerical values from 1 to 10, which the player will enter by keyboard before the program deals. The following functions must be implemented/used: enterDeckValues. - This…Using function calls, write a program to spell out the word MISSISSIPPI using block letters like the following. M M MM MM M M M M M M M M M M M M M IIIIIII I I I I I IIIIIIII SSSSSS S S S SSSSSS S S S SSSSSS and so on.. Java coding Make sure to use static methods so that you main program is easy to read.Python Write a program that receives a number from a user and checks if it's float or integer.In case of being float, print for the user that his/her number is float with integer part andfractional part. In case of being integer, print to the user that his/her number is aninteger and odd/even numbeR
- The Research team led by Bernadette Wolowitz at Cal-tech University has discovered a new Amoeba that grows in the order of a Fibonacci series every month. They are exhibiting this amoeba in a national. conference. They want to know the size of the amoeba at a particular time instant. If a particular month's index is given, write a program to display the amoeba's size. For Example, the size of the amoeba on month 1, 2, 3, 4, 5, 6,... will be 0, 1, 1, 2, 3, 5, 8.... respectively.Write a program that takes a positive integer x greater than zero typed in by the user, and prints the count from x to x+9 (including this one) using printf with newline after each printed value. Example: if x=1, the program should print:Write a program that takes in an integer in the range 20-98 as input. The output is a countdown starting from the integer, and stopping when both output digits are identical. Ex: If the input is 93, the output is: 93 92 91 90 89 88 Ex: If the input is 77, the output is: 77 Ex: If the input is not between 20 and 98 (inclusive), the output is: Input must be 20-98 For coding simplicity, follow each output number by a space, even the last one. Use a while loop. Compare the digits; do not write a large if-else for all possible same-digit numbers (11, 22, 33, ..., 88), as that approach would be cumbersome for large ranges.