Concept explainers
In the following exercises, write a
Equivalent Interest Rates Interest earned on municipal bonds from an investor's home state is not taxed, whereas interest earned on CDs is taxed. Therefore, in order for a CD to earn as much as a municipal bond, the CD must pay a higher interest rate. How much higher the interest rate must be depends on the investor's tax bracket. Write a program that allows the user to enter a tax bracket and a municipal bond interest rate and then finds the CD interest rate with the same yield. See Fig. 3.40. Note: If the tax bracket is expressed as a decimal,
then
Want to see the full answer?
Check out a sample textbook solutionChapter 3 Solutions
Introduction To Programming Using Visual Basic (11th Edition)
Additional Engineering Textbook Solutions
Starting Out with C++ from Control Structures to Objects (9th Edition)
Software Engineering (10th Edition)
Starting Out with C++: Early Objects
Starting Out with Programming Logic and Design (5th Edition) (What's New in Computer Science)
Java: An Introduction to Problem Solving and Programming (8th Edition)
Database Concepts (7th Edition)
- (Program) Write a program to simulate the rolling of two dice. If the total of the two dice is 7 or 11, you win; otherwise, you lose. Embellish this program as much as you like with betting, different odds, different combinations for win or lose, stopping play when you have no money left or reach the house limit, displaying the dice, and so forth. (Hint: Calculate the dots showing on each die with theexpressiondots=(int)(6.0randomnumber+1), where random number is between 0 and 1.)arrow_forward(Statistics) This is the formula for the standard normal deviate, z, used in statistical applications: z=(X)/ X is a single value. refers to an average value. refers to a standard deviation. Using this formula, you need to write a program that calculates and displays the value of the standard normal deviate when X=85.3,=80,and=4. a. For this programming problem, how many outputs are required? b. How many inputs does this problem have? c. Determine a formula for converting input items into output items. d. Test the formula written for Exercise 7c, using the data given in the problem.arrow_forward(Simulation) Write a program to simulate the roll of two dice. If the total of the two dice is 7 or 11, you win; otherwise, you lose. Embellish this program as much as you like, with betting, different odds, different combinations for win or lose, stopping play when you have no money left or reach the house limit, displaying the dice, and so forth. (Hint: Calculate the dots showing on each die with the expression dots=(int)(6.0randomnumber+1), where the random number is between 0 and 1.)arrow_forward
- (Modify) a. Modify the program you wrote for Exercise 7 to provide the mass of a person as an output, given his or her weight as an input to the program. Use your program to determine the mass of a person who weighs 140 lbf on Earth. b. Modify the program written for Exercise 7a to also output the personβs weight on Mars and the moon. The pull of gravity on Mars is 12.54ft/sec2=3.728m/s2,andonthemoonis5.33ft/sec2=1.625m/s2.arrow_forwardNote: write a Jave Progame below Question2: Β Suppose a retail business sells an item that is regularly priced at $98 and is planning to have a sale where the item s price will he reduced by 25 percent. You have been asked to write a program to calculate the sale price of the item. To determine the sale price you perform two calculations: you get the amount of the discount, which is 25 percent of the item's regular price. you subtract the discount amount from the item's regular price. This gives you the sale price.arrow_forwardI am having issues on trying to get the profit this is the question- In theΒ ChiliToGoΒ program in Exercise 12, the costs to produce an adult meal and a childβs meal are $4.35 and $3.10, respectively. Adult meals are sold for $7 and children's meals are sold for $4. Modify theΒ ChiliToGoΒ program to display the total profit for each type of meal as well as the grand total profit. This is what code it starts with-Β importΒ java.util.Scanner; classΒ ChiliToGoProfit { Β Β publicΒ staticΒ voidΒ main(String[]Β args)Β { Β Β Β Β Β Β //Β ModifyΒ theΒ codeΒ below Β Β Β Β Β Β finalΒ doubleΒ ADULT_PRICEΒ =Β 7; Β Β Β Β Β Β finalΒ doubleΒ CHILD_PRICEΒ =Β 4; Β Β Β Β Β Β intΒ adultMeals; Β Β Β Β Β Β intΒ childMeals; Β Β Β Β Β Β doubleΒ totalAdult,Β totalChild,Β grandTotal; Β Β Β Β Β Β ScannerΒ inputΒ =Β newΒ Scanner(System.in); Β Β Β Β Β Β System.out.print("EnterΒ numberΒ ofΒ adultΒ mealsΒ orderedΒ >>Β "); Β Β Β Β Β Β adultMealsΒ =Β input.nextInt(); Β Β Β Β Β Β System.out.print("EnterΒ numberΒ ofΒ childΒ mealsΒ orderedΒ >>Β "); Β Β Β Β Β Β childMealsΒ =Β input.nextInt(); Β Β Β Β Β Β totalAdultΒ =Β adultMealsΒ *β¦arrow_forward
- Bob is playing a game. He and his team have come up with a plan to throw a ball so that it can hit the target object. The target is at a distance of X meters from Bob. He is at a height of Y meters from the ground and the target is at a height of Z meters from the ground. Bob can throw the ball with a certain speed Task Determine the speed that he should throw the ball. Notes He is aiming at an angle parallel to the ground. Assume acceleration due to gravity is 10m/sΒ² Example Assumptions β’ X = 2 β’ Y=5 β’ Z=2 Β Approach It can be calculated that he needs to fire at speeds 2.58m/s at an angle parallel to the ground respectively. The answers are taken up to 2 decimal places only. Hence, the answer is 2.58 m/s. Function description Complete the solve function provided in the editor. This function takes the following 3 parameters and returns the minimum speed required: β’ X Represents an integer denoting the distance of the target from Bob β’ Y Represents an integer denoting the height of Bobβ¦arrow_forwardAssignment Write a program that moves a forester unit and a desert corps unit to a given target location and prints the number of hours it took for each unit to reach the target. First, the user will give the starting X and Y positions of the forester unit as well as its base speed (all ints). Then, the starting X and Y positions of the desert corps unit as well as its base speed (all ints). Finally, the target X and Y positions (both ints) and the terrain type (std::string). Speeds are given as distance traveled in one full day (i.e., 24 hours) and is affected by the terrain type using a multiplier over the base speed. Also, after 1 full day, each unit rests for a certain number of hours. Speed multiplier and rest amount of each type of unit depending on the terrain type are as below. Speed Multiplier Rest Duration After 1 day Terrain type Forester Desert Corps Forester Desert Corps Forest 1.3 0.6 4 12 Desert 0.4 1.2 15 6 Hills 0.7 0.8 6 8 Others 1.0 0.8 8 6 After getting all thisβ¦arrow_forwardSummary When you borrow money to buy a house, a car, or for some other purposes, then you typically repay it by making periodic payments. Suppose that the loan amount is L, r is the interest rate per year, m is the number of payments in a year, and the loan is for t years. Suppose that i = (r / m) and r is in decimal. Then the periodic payment is (first image which R=....): Β Β You can also calculate the unpaid loan balance after making certain payments. For example, the unpaid balance after making k payments is (second image which L'=....) : Β Β whereΒ RΒ is the periodic payment. (Note that if the payments are monthly, thenΒ m = 12.) Instructions Write a program that prompts the user to input the values ofΒ L, r, m, t, and k. The program then outputs the appropriate values. Your program must contain at least two functions, with appropriate parameters, to calculate the periodic payments and the unpaid balance after certain payments. Make the program menu driven and use a loop so that theβ¦arrow_forward
- Problem: Write a program for computing the amount of money in a bank account at the end of each quarter for a period of one year. A quarter is equivalent to 3 months. Assume that the account is created at the beginning of a year (i.e. January 1). The year will be entered at run time through the keyboard. The account has an initial principal that is entered at run time through the keyboard. No deposit or withdrawal is made within the one-year period. The interest is compounded quarterly which means that the interest earned for the first quarter will form part of the principal for the second quarter, the interest earned for the second quarter will form part of the principal for the third quarter and so on. The annual interest rate is 5%. The interest rate for a quarter is computed by dividing the annual interest rate by 4 since there are four quarters in a year. The computational procedure (see algorithm) and the output of the program (see sample run) are shown below. The output includesβ¦arrow_forwardTask 1 Description let's consider a case when you need a lot of coffee. Maybe you're hosting a party with a lot of guests! In these circumstances, it's better to make preparations in advance.So, we will ask a user to enter the desired amount of coffee, in cups. Given this, you can adjust the program by calculating how much water, coffee, and milk are necessary to make the specified amount of coffee.Of course, all this coffee is not needed right now, so at this stage, the coffee machine doesn't actually make any coffee yet. Objectives Let's break the task into several steps:First, read the numbers of coffee drinks from the input.Figure out how much of each ingredient the machine will need. Note that one cup of coffee made on this coffee machine contains 200 ml of water, 50 ml of milk, and 15 g of coffee beans. Output the required ingredient amounts back to the user.ExamplesThe greater-than symbol followed by space (> ) represents the user input. Notice that it's not the part of theβ¦arrow_forwardWrite a program to calculate the total final marks for a subject. There are four assessment types for the subject. Below are the percentages of the marks that will be taken into account for the Total Finall Marks (refer Table 1). Table 1 : Total Finall Marks Percentages Assessment Type Original Marks Percentage taken from original marks Finalll Eexam 100 50% Quiz 50 20% Lab 50 20% Assignment 20 10% Β Total Final Marks 100%arrow_forward
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage LearningC++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology Ptr