Task 1: Write a program that will add the marks of a student in Theory and in practical of C Programming and test whether the mark is passed or failed. If the total mark is >= 75, the message displayed should be "You passed the coursel". Otherwise, the message should be "You failed the coursel"
Q: TASK 3: Write a program that accepts the input code from the user and print according to the input…
A: in c: #include <stdio.h>int main(){ int n1; printf("enter the number: ");…
Q: Need Help solving this in C++ language . Prompt for and get the user’s number of donuts to buy…
A: In this program, you need to take input from user for number of donuts and number of people. After…
Q: PROBLEM: Write a C++ program that will allow the user to input the First Name, Last name, Middle…
A: - We need to create the grade program.
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: Write a program that displays the differences between the first and last, the second and next to…
A: Program description: n is the user input integer variable that stores the number of elements in the…
Q: Write C++ program that accepts coefficients of a quadratic equation from the user and displays the…
A: #include <iostream>#include <cmath>using namespace std;int main() { float a, b, c,…
Q: HW5: Write a program in C language by using if statement for the gear system in automatic cars,…
A: Step 1:- Program Approach:- 1.Include the header file 2.Declare the variable of a data type…
Q: Task 3: Write a program for a matchstick game being played between the computer and a user. Your…
A: The solution code for the above given problem is given below: - CODE: - #include<stdio.h>…
Q: 1. Write a complete C++ program that asks the user to type a big integer n. It should then ask 4…
A: Given:
Q: PROBLEM: Write a C++ program that will allow the user to input the First Name, Last name, Middle…
A: #include <iostream>using namespace std; int main(){ string FirstName, LastName,…
Q: Write a program that, given a number of hours, calculates the number of weeks, days, and hours…
A: Question 1 : Algorithm : Step 1 : declaring and initializing the variables. Step 2 : ask for…
Q: Write a c++ program Write a program that ask sthe user to enter the value of four angles (in…
A: #include<iostream> // It is "iostream" is C++ standard library which helps to implement…
Q: Q1/Write a program in C ++ that raises a number to powers without using the command pow(,) is…
A: This program will take two numbers from the user (a base number and exponent) and calculates the…
Q: Write a C++ program. A software company sells a package that retails for $109. Quantity discounts…
A: To write a C++ program using the if/else if/else statement that asks for the number of units sold…
Q: Write a C Program A bank wants a program that determines the yearly interest earned on a guaranteed…
A: #include<stdio.h> int main(){ //declare the variables to store amount, interest, term…
Q: Q3 Write a C++ program to find the sea wave speed (c) for the rang of water depths {0,5,10,15,20…
A: Algorithm: Start Set PI=3.14 Set g=9.81 Read L Read d Compute: k = L/(2*PI) IF (d/L)<0.05: c…
Q: Write a program in C to enter the numbers till the user wants and at the end it should display the…
A: Find the required code in C given as below and 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: Mars hyper market gives discount to customers based on their spending. If a customer spends 20 Omani…
A: #include<iostream>using namespace std;int main(){ float spending; cin>>spending;…
Q: PROBLEM: Write a C++ program that will allow the user to input the First Name, Last name, Middle…
A: 1)Read the input from the user first name, last name, middle initial and Grade 2)Display the first…
Q: In C#, please? Write a program named CheckMonth2 that prompts a user to enter a birth month and…
A: Code Snippet: using System; namespace birthdayCheck{ class CheckMonth2 { static void…
Q: Write a program that reads the marks of a student in the test (te), midterm (mid), assignment…
A: Code: #include<stdio.h> int main(){ int tm,mid,assig,fe,pm; printf("Enter…
Q: 4. Write a C++ program to implement the Number Guessing Game. In this game the computer chooses a…
A: Write a C++ program to implement the Number Guessing Game. In this game the computer chooses a…
Q: -> in C++ Write a program that takes a sentence, and squeezes the words that have the same ending as…
A: #include <iostream> #include <sstream> #include<string>…
Q: Write a program that, given the time duration of a task in the number of hours, minutes, and…
A: I have provided c++ code in step2
Q: Write a program in C that asks the user to insert the temperature value in Celsius (°C). The program…
A: Algorithm: Start Read temperature in Celsius Calculate fahrenheit=(celsius*9/5)+32 Print fahrenheit…
Q: A) Use (switch statement) to write a program in C++ to show company structure. I r is (A), print…
A: Here we need to use switch case on some character input. The syntax for switch case is…
Q: Problem 7: Guess the price of the car!? You will implement a variant of the number guessing game we…
A: Python used to answer this question
Q: Write a program that illustrates the application of multiple catch statement
A:
Q: 7. Write a C++ program that calculates and prints the bill for a car rental company. The company…
A: Code: #include <iostream> using namespace std; int main() { // Declaring arrays with…
Q: In C++ language, create a program that gets quarterly sales from a user, and calculates the total of…
A: - We need to code for the sales program.
Q: A triangular number or triangle number counts the objects that can form an equilateral triangle. The…
A: Program Explanation: The header file “<iostream>” is declared that contains all standard…
Q: create a program in c that promts the user to enter a "bank amount" and a "wager amount". If the…
A: Take a variable for the bank amount as input. Take a variable for the wager amount as input. Use a…
Q: Jason Hardy opened a coffee shop at the beach and sells coffee in three sizes: small (9 oz), medium…
A: Answer :- #include <iostream> #include <iomanip> using namespace std; //constants…
Q: Problem 4. Write a program that will accept the tuition fee and compute the total tuition fee based…
A: Accept tution fee as integer and then find the total amount and the convert to integer and display…
Q: Write a program that inputs a line of text, replaces all punctuation marks with spaces.
A: Program: //header files #include <iostream> #include <string> using namespace std;…
Q: A pangram sentence is a sentence that contains every letter of the alphabet at least once. The most…
A: Program Approach: Include all the necessary header files . Define a boolean function that…
Q: (Apartment problem) A real estate office handles, say, 50 apartment units. When the rent is, say,…
A: File name: “main.cpp” //Import the header files #include <iostream> #include<iomanip>…
Q: What should be the output of below program in C++ LANGUAGE? # include void main O { int a = 1;…
A: here we initialized a=1 so in switch it searches for the case with value 1 it found in the first…
Q: Q2. Write a program that reports the contents of a compressed-gas cylinder based on the first letter…
A: C program
Q: Write a C++ program that asks the user to enter the radius of the circle and then find the…
A: As per the requirement program is developed in c++. Algorithm: Step 1: Define the pi constant to the…
Q: Use C++ programming language A customer in a store is purchasing five items. The prices of the…
A: Algorithm: Start Store the price of 5 items in p1,p2,p3,p4 and p5 variables Print p1,p2,p3,p4 and…
Q: 5- Write a C program that reads a number and check whether its' prime or not. Note: a prime number…
A: Write a C program that reads a number and check whether it's prime or not. A prime number is that…
Q: Write a C program that asks a student to enter his/her scores in Test 1, Test 2, and Test 3, and…
A: C program to prompt the user to enter his/her scores. Assuming that the maximum score is 100. Store…
Q: Project 2: Truth Table: Write a program that displays the truth table for a proposition with two…
A: Code: #include<iostream>using namespace std; char getValue(int f){ return (f)?'T':'F';}int…
Q: Using C#, write a program that takes a decimal value between 1 and 10 and displays its equivalent…
A: This can be done using basic condition check and here we provided solution using switch statements
Step by step
Solved in 2 steps with 2 images
- C++ Programming Exercise: A real estate office handles, say, 50 apartment units. When the rent is, say, $600 per month, all the units are occupied. However, for each, say, $40 increase in rent, one unit becomes vacant. Moreover, each occupied unit requires an average of $27 per month for maintenance. How many units should be rented to maximize the profit? Write a program that prompts the user to enter: a. The total number of of units. b. The rent to occupy all the units. c. The increase in rent that results in a vacant unit. d. Amount to maintain a rented unit. The program then outputs the number of units to be rented to maximize the profit.C++ only Upvote for your own work and correct answer/ Downvote for copying the answer from a different website. It must be in C++ and it must be a working code. It needs to follow the required directions for example: MAKE SURE IT POINTS OUT EVERY TIME THE STATEMENT IS INVALID IF IT IS INDEED INVALID. Thank You. Assignment: Create a C++ program that can test the validity of propositional logic. Remember, a propositional logical statement is invalid should you find any combination of input where the PROPOSITIONAL statements are ALL true, while the CONCLUSION statement is false. Propositional Statements: If someone has a rocket, that implies they’re an astronaut. If someone is an astronaut, that implies they’re highly trained. If someone is highly trained, that implies they’re educated. Conclusion Statement: A person is educated, which implies they have a rocket. Your output should declare the statement to either be valid or invalid. If it’s invalid, it needs to state which combination…c++ Write a program to use enumeration type to represent the seven colors of the rainbow, i.e. red, orange, yellow, green, blue, indigo and violet, as the enumerators in sequence, and red starts from 1. Then, ask the user to choose a value between the range of 1 – 7. If the user enters 3, the output will tell the user yellow has been chosen, and also display the previous and next colors of the chosen colors. If the user enters 1 or 7, display the chosen color and only next/previous color is displayed accordingly. Write the program in an infinite while loop, until a number which is beyond the range of 1 – 7 is entered. The sample output is as follows, Enter a number in the sequence of the rainbow color (1-7): 7 Violet is chosen. The previous color is indigo. Enter a number in the sequence of the rainbow color (1-7): 1 Red color is chosen. The next color is orange. Enter a number in the sequence of the rainbow color (1-7): 3Yellow is chosen. The previous color is orange and next…
- In C++ (Find the number of days in a month) Write a program that prompts the user to enter the month and year and displays the number of days in the month. For example, if the user entered month 2 and year 2012, the program should display February 2012 has 29 days If the user entered month 3 and year 2015, the program should display March 2015 has 31 daysC++ Programming Exercise: When you borrow money to buy a house, a car, or for some other purpose, you repay the loan by making periodic payments over a certain period of time. Of course, the lending company will charge interest on the loan. Every periodic payment consists of the interest on the loan and the payment toward the principal amount. To be specific, suppose that you borrow $1,000 at an interest rate of 7.2% per year and the payments are monthly. Suppose that your monthly payment is $25. Now, the interest is 7.2% per year and the payments are monthly, so the interest rate per month is 7.2/12 = 0.6%. The first month's interest on $1,000 is 1000 X 0.006 = 6. Becuase the payment is $25 and the interest of the first month is $6, the payment toward the principal amount is 25-6 = 19. This means after making the first payment, the loan amount is 1,000-19 = 981. For the second payment, the interest is calculated on $981. So the interest for the second month is 981 X 0.006 = 5.886,…Note:solution using c++ language Pre-Lab 01: Write a program that reads a positive integer x from the user. If x is even, the program prints all the odd numbers between 1 and x – inclusive - each on a separate line. If x is not even, the program prints all the numbers that are multiples of 4 between 1 and x+10 -inclusive -, each on a separate line. Note: As long as the user does not enter a positive number, the program will repeatedly ask the user to enter a positive number. The program must also print an error message "Error- TRY AGAIN – You should enter a positive integer to continue". Úe do.. while to insure the user input.
- Using c++ 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 total charges5- Write a C program that reads a number and check whether its' prime or not. Note: a prime number is the number that can only be divisible by 1 and it's self. Examples: 2, 3, 5, 7, 11, 13... etc.C++ Demonstration: Write a program that computes the equivalent resistance of a purely series and purely parallel electric circuit. TEST CASES: If the user inputs a character: Computing for the equivalent resistance A. Series CombinationB. Parallel Combination Enter Choice: B Enter R1: 1 Enter R2: 2 Enter R3: A The value of R3 is not a number. If the user selects “Series Combination” and inputs numbers: Computing for the equivalent resistance A. Series Combination B. Parallel Combination Enter Choice: A Enter R1: 1 Enter R2: 2 Enter R3: 3 The total resistance in series is 6 Ohms.
- Using c++ write a program : Write a program in C++ to handle the following scenario: Three friends Asif, Shahid and Bashir start the business. Input following from user. Enter amount invested by Asif (user will enter any value) Bashir’s contribution is equal to 250% of Asif’s contribution and Shahid’s contribution is equal to 75% of Bashir’s contribution. Display amount contributed by Bashir and Shahid. After 6 months business earned profit of 50% of total investment. Display the total profit and the amount each sharer will get (i.e. distribute profit as per percentage of their investment).Switch Statement Problem 5. Electric Bill: Write a program that will calculate and show bills of the Manila Electric Company. The rates vary depending on whether the use is residential (R), commercial( C), or industrial (1). Any other code should be treated as an error. The program should accept the subscriber ID, Subscriber Name, his total electrical consumption in a month, and the code of the consumer type. The rates are computed as follows: R: 50 plus .50 per kwh used C: 100 for the first 1000 kwh and 0.45 for each additional kwh I: 180 for the first 1000 kwh and 0.75 for each additional kwhNeeds to be done in C# language. Problem 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 in-patient or an out-patient. If the patient was an in-patient, the following data should be entered: • The number of days spent in the hospital• The daily rate• Hospital medication charges• Charges for hospital services (lab tests, etc.) The program should ask for the following data if the patient was an out-patient: • Charges for hospital services (lab tests, etc.)• Hospital medication charges The program should use two overloaded functions to calculate the total charges. One of the functions should accept arguments for the in-patient data, while the other function accepts arguments for out-patient information. Both functions should return the total charges. Input Validation: Do not accept negative numbers for any data.