1. Write a C++ program that evaluates the following function based on x value that will...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
1. Write a C++ program that evaluates the following function based on x value that will be given by the user. sin(xx) x² (x +ex(x+1) x < -1 -n≤x≤n x>n f(x) = 0 = { 2. Write a C++ program that prompts the user to input the x-y coordinate of a point in the Cartesian plane. The program should then output a message indicating whether the point is the origin, is located on the x- (or y-) axis, or appears in a particular quadrant. For example: (0,0) is the origin (4,0) is on the x-axis (0,-3) is on the y-axis (-2,3) is in the second quadrant 3. Write program to perform simple banking operations. The user at first will be given a starting balance. Then, he will be asked to select one of the following operations: deposit, withdraw or balance inquiry. The account should not allow overdrafts (i.e. Withdraw an amount greater than the current balance) and should prevent user from entering negative values for withdraw and deposit. The program should display the final balance after it performs any deposit or withdraw operation requested by the user. 4. Write a C++ program that calculates and prints the bill for a car rental company. The company charges a daily fee for each day a car is rented depending on the type of the car. Moreover, an additional fee is charged if the car travels more than 400 KM. This fee also varies depending on the type of the car. Type of car Mercedes Toyota Cadillac Jaguar Daily fee 150 60 120 130 Fee for additional KM 15 7 10 Your program should ask the user to enter The type of the car (M or m for Mercedes, T or t for Toyota...) How many days was the car rented? How many KM did the car travel? 5. Write a program that calculates and displays a person's body mass index (BMI). The BMI is often used to determine whether a person is overweight or underweight for his or her height. A person's BMI is calculated with the following formula: 1. Write a C++ program that evaluates the following function based on x value that will be given by the user. sin(xx) x² (x +ex(x+1) x < -1 -n≤x≤n x>n f(x) = 0 = { 2. Write a C++ program that prompts the user to input the x-y coordinate of a point in the Cartesian plane. The program should then output a message indicating whether the point is the origin, is located on the x- (or y-) axis, or appears in a particular quadrant. For example: (0,0) is the origin (4,0) is on the x-axis (0,-3) is on the y-axis (-2,3) is in the second quadrant 3. Write program to perform simple banking operations. The user at first will be given a starting balance. Then, he will be asked to select one of the following operations: deposit, withdraw or balance inquiry. The account should not allow overdrafts (i.e. Withdraw an amount greater than the current balance) and should prevent user from entering negative values for withdraw and deposit. The program should display the final balance after it performs any deposit or withdraw operation requested by the user. 4. Write a C++ program that calculates and prints the bill for a car rental company. The company charges a daily fee for each day a car is rented depending on the type of the car. Moreover, an additional fee is charged if the car travels more than 400 KM. This fee also varies depending on the type of the car. Type of car Mercedes Toyota Cadillac Jaguar Daily fee 150 60 120 130 Fee for additional KM 15 7 10 Your program should ask the user to enter The type of the car (M or m for Mercedes, T or t for Toyota...) How many days was the car rented? How many KM did the car travel? 5. Write a program that calculates and displays a person's body mass index (BMI). The BMI is often used to determine whether a person is overweight or underweight for his or her height. A person's BMI is calculated with the following formula:
Expert Answer:
Answer rating: 100% (QA)
Here are the C programs for each of the specified tasks 1 Evaluate Function cpp include include int main double x Get user input for x stdcout Enter t... View the full answer
Related Book For
Introduction to Java Programming, Comprehensive Version
ISBN: 978-0133761313
10th Edition
Authors: Y. Daniel Liang
Posted Date:
Students also viewed these computer network questions
-
Add a foreign key Payment_id and location to this table CREATE TABLE public. "Services" ( customer_id character varying (30) COLLATE pg_catalog. "default" NOT NULL, internetservice text COLLATE...
-
You are to write a C program that will read from a file, one or more sets of x,y coordinates. Each set of coordinates is part of a Cartesian system. A Cartesian coordinate system is a system that...
-
Goodwill impairment tests are carried out annually. During 2014, goodwill impairment was determined to be $26,000 on the parents share of goodwill and $5,000 on the NCI share. In 2016, impairment in...
-
Erin Danielle Company purchased equipment and incurred the following costs. What amount should be recorded as the cost of the equipment? (a) $24,000. (c) $25,400. (b) $25,200. (d) $25,800. Cash price...
-
What communication "lessons" does this fable offer to those who are serious about careers in the new workplace?
-
A co-op student, working for Insidz Co., recorded the company's transactions for the month. At the end of the month, the owner of Insidz Co. reviewed the student's work and had some questions about...
-
In Exercises 1518, use the given set of points to a. Compute b1. b. Compute the residual standard deviation se. c. Compute the sum of squares for x, (x x)2. d. Compute the standard error of b1, sb....
-
A particular stock sells for $30. The stocks beta is 1.25, the risk-free rate is 4%, and the expected return on the market portfolio is 10%. If you forecast that the stock will be worth $33 next year...
-
1. Melissa has saved $69,600.00. If she decides to withdraw $3,326.00 at the beginning of every month and interest is 7.03 % compounded annually, for how long can she make withdrawals? Express your...
-
Sandra?s Purse Boutique has the following transactions related to its top-selling Gucci purse for the month of October. Required: 1. Calculate ending inventory and cost of goods sold at October 31,...
-
Interest rate is one of the key macroeconomic (intermediate) variables when it comes to the conduct of monetary policy. Questions i. Explain the concept of interest rate and show how the Bank of...
-
Which of the following statements about no-argument constructors and inheritance are correct? (Choose two.) A. The compiler cannot insert a no-argument constructor into an abstract class. B. If a...
-
Which of the following variables are always in scope for the entire program once defined? A. Package variables B. Class variables C. Instance variables D. Local variables
-
How many cells in the following table are incorrect? A. Zero B. One C. Two D. Three E. Four Allows abstract methods? Type Abstract class Yes Concrete class Yes Interface Yes Allows constants? Yes Yes...
-
Which of the following are valid class declarations? (Choose three.) A. class {} B. class river {} C. class Str3@m {} D. class Pond2$ {} E. class _var_ {} F. class 50cean {}
-
Which variables have a scope limited to a method? A. Interface variables B. Class variables C. Instance variables D. Local variables
-
1. The signal x(1) shown in Figurel may be expressed as x(1) 12 t- x(4) - Atri(-) + Brees (*) - Crece (4) (175) + = 9 6 Find the values of A, a, B, b, B, C, c and X. 3 2. Draw a labeled sketch of...
-
For Problem estimate the change in y for the given change in x. y = f(x), f'(12) = 30, x increases from 12 to 12.2
-
Write a program that displays a moving text, as shown in Figure 15.33a and b. The text moves from left to right circularly. When it disappears in the right, it reappears from the left. The text...
-
ISBN-13 is a new standard for indentifying books. It uses 13 digits d 1 d 2 d 3 d 4 d 5 d 6 d 7 d 8 d 9 d 10 d 11 d 12 d 13 . The last digit d 13 is a checksum, which is calculated from the other...
-
Write a method that finds the number of occurrences of a specified character in a string using the following header: public static int count(String str, char a) For example, count("Welcome", 'e')...
-
Determine the displacement at \(C\) and the slope of the beam at \(A, B\), and \(C\). \(E I\) is constant. A B 8 kNm -6 m + -3 m
-
The composite simply supported steel shaft is subjected to a force of \(10 \mathrm{kN}\) at its center. Determine its maximum deflection. \(E_{\mathrm{st}}=200 \mathrm{GPa}\). 200 mm A 200 mm 200 mm...
-
Determine the magnitude of force \(\mathbf{F}\) that must be applied at the end of the overhang \(C\) so that when the force \(\mathbf{P}\) is applied, displacement at \(C\) is zero. \(E I\) is...
Study smarter with the SolutionInn App