Concept explainers
In the following exercises, write a
Word Replacement Write a program that requests a sentence, a word in the sentence, and another word and then displays the sentence with the first word replaced by the second. In Fig 3.34 the user responds by typing “What you don ‘t know won’t hurt you.� Into the first text box the “know� and “owe� into the second the third text boxes, and the message “What you don ‘t owe won’t hurt you�. Is displayed.
Want to see the full answer?
Check out a sample textbook solutionChapter 3 Solutions
Pearson eText for Introduction to Programming Using Visual Basic -- Instant Access (Pearson+)
Additional Engineering Textbook Solutions
Starting Out with Java: From Control Structures through Objects (6th Edition)
Database Concepts (7th Edition)
Java: An Introduction to Problem Solving and Programming (7th Edition)
Starting Out with Java: From Control Structures through Objects (7th Edition) (What's New in Computer Science)
Starting Out with Java: Early Objects (6th Edition)
Objects First with Java: A Practical Introduction Using BlueJ (6th Edition)
- Question2: Write a program to determine a student's final grade for (Structure, Strength of materials, and Engineering Mathematics) indicate whether it is passing or failing. The final grade is obtained by adding the sum of the oral, attendance, and theoretical activity grades to the average of the three material. by QBasicarrow_forwardTask 3: High cholesteral and high triglycerides have been assicuated with cardiovascular disease. During yearly medical visits a doctor might recommend certain actions if certain test results are received (see Table 1). Write a program that allows the user to enter the numeric cholesteral and triglyceride results and the gives the doctor a recommendation. Please show step-by-step on LabVIEW. Table 1 Recomendation Triglyceride (mg/fL) Total cholesteralSuggest a full workup >886 >240 mg/dLSuggest change in diet 500 to 886 200 to 239Suggest change in activity 150 to 499 N/AAll good <150 <200 Task 4: Create a new version of your file for Task 4. Add two boolean indicators (Round LED). Oneshould light up when both Triglyceride AND Cholesteral levels are in the “All good” range. Theother should light up when either Triglyceride OR Cholesteral levels are in the “Suggest a fullworkup” range. Please show step-by-step on LabVIEW.arrow_forward21. GeeBees Clothiers is having a sale. The store manager wants a program that allows a salesclerk to enter the original price of an item and the discount rate. The program should calculate and display the amount of the discount and the sale price. The algorithm in Figure 2-21 is supposed to solve this problem, but it is not working correctly. Correct the algorithm, and then desk-check it using an original price of $100 and a discount rate of .25 (the decimal equivalent of 25%). Output: discount sale price oviginal príce discount rate Imput: Algorithm: 1. enter the original price and discount rate 2. calculate the sale price by subtracting the discount from the original price 3. display the discount and pricearrow_forward
- Armstrong numbers between two intervals Write a program to print all the Armstrong numbers in the given range A to B (including A and B). An N -digit number is an Armstrong number if the number equals the sum of the Nth power of its digits. Input The first line has an integer A. The second line has an integer B. Output Print all Armstrong numbers separated by a space. If there are no Armstrong numbers in the given range, print -1 .arrow_forwardComputer sciencearrow_forwardGrowth of an Investment Suppose a fixed amount of money is deposited at the beginning of each month into an investment paying 6% interest compounded monthly. After each deposit is made, [new balance]=1.005∗[previous balance one month ago]+ [fixed amount]. Write a program that requests the fixed amount of the deposits as input and displays the balance after each of the first four deposits. See Fig. 5.14.arrow_forward
- In cengage mindtap The credit plan at TidBit Computer Store specifies a 10% down payment and an annual interest rate of 12%. Monthly payments are 5% of the listed purchase price, minus the down payment. Write a program that takes the purchase price as input. The program should display a table, with appropriate headers, of a payment schedule for the lifetime of the loan. Each row of the table should contain the following items: The month number (beginning with 1) The current total balance owed The interest owed for that month The amount of principal owed for that month The payment for that month The balance remaining after payment The amount of interest for a month is equal to balance × rate / 12. The amount of principal for a month is equal to the monthly payment minus the interest owed.arrow_forwardneed help!arrow_forward26. A room has one door, two windows, and a built-in bookshelf and it needs to be painted. Suppose that one gallon of paint can paint 120 square feet. Write a program that prompts the user to input the lengths and widths of the door, each window, the bookshelf; and the length, width, and height of the room (in feet). The program outputs the amount of paint needed to paint the walls of the room.arrow_forward
- French Articles: French country names are feminine when they end with the letter e, masculine otherwise, except for the following which are masculine even though they end with e: le Belize le Cambodge le Mexique le Mozambique le Zaïre le Zimbabwe Write a program that reads the French name of a country and adds the article: le for masculine or la for feminine, such as le Canada or la Belgique. However, if the country name starts with a vowel, use l’; for example, l’Afghanistan. For the following plural country names, use les: les Etats-Unis les Pays-Basarrow_forward10. The algorithm shown in Figure 1-13 should calculate and print the gross pay for five workers; however, some of the instructions are missing from the algorithm. Complete the algorithm. If an employee works more than 40 hours, he or she should receive time and one-half for the hours worked over 40. read the employee's name, hours worked, and pay rate calculate gross pay = hours worked times pay rate otherwise, do this: calculate regular pay = pay rate times 40 calculate overtime hours = hours worked minus 40 calculate overtime pay = calculate gross pay = end if print the employee's name and gross pay end repeatarrow_forwardQuestion 3 write a program to draw the picture below.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