In the following exercises, write a
Write a program that allows the user to enter a whole number of inches and then converts that length to feet and inches. See Fig. 3.39. The program should use both integer division and the Mod operator.
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 C++: Early Objects
Starting out with Visual C# (4th Edition)
Introduction to Java Programming and Data Structures, Comprehensive Version (11th Edition)
Java: An Introduction to Problem Solving and Programming (8th Edition)
Starting Out with Python (4th Edition)
Objects First with Java: A Practical Introduction Using BlueJ (6th Edition)
- Modify the BarChart program from Chapter 6 Exercise 13 to accept the number of points scored by each player in a season. The bar chart displays one asterisk for each 10 points scored by a player. For example, if a player has scored 48 points, then display 4 asterisks. An example of the program is shown below: Enter points earned for the season by Art >> 10 by Bob >> 20 by Cal >> 30 by Dan >> 40 by Eli >> 50 Points for Season (each asterisk represents 10 points) Art * Bob ** Cal *** Dan **** Eli ***** import java.util.Scanner; public class BarChart2 { public static void main (String[] args) { Scanner input = new Scanner(System.in); int artPoints; int bobPoints; int calPoints; int danPoints; int eliPoints; final int AMT_EACH_ASTERISK = 10; System.out.println("Enter points earned for the season"); System.out.print(" by Art >> "); artPoints = input.nextInt();…arrow_forward25. Repeat Programming Exercise 24, but the wire is to be bent in the form of a circle. In this case, the user specifies the length of the wire and the program outputs the radius and area of the circle. (You may assume that . Also declare it as a named constant.)arrow_forwardPrice-to-Earnings Ratio Request a company’s earnings-per-share for the year and the price of one share of stock as input, and then display the company’s price-to-earnings ratio (that is, price/earnings). See Fig. 3.25.arrow_forward
- Question 3 (12 Points) of laps that they have run around a racetrack. Then, prompt the user to enter the time of each lap (in minutes). The program should calculate and display the fastest lap and the average lap time of all laps.arrow_forwardWrite pseudocode for each example (a through e) in Exercise 2, making sure your pseudocode is structured and accomplishes the same tasks as the flowchart segment.arrow_forwardExercise 5: Part I Use of different controls and functions 1. Program to find sum, minimum, maximum, average using radio buttons 2. Program to show length of string 3. Program to show hobbies of people using check box 4. Program to display cities of Oman in combo box 5. Write a program to calculate the numbers of years the employee is working (hint use two datetime Picker, 1 label, and 1 button and datediff function) 6. Program to change the color of form on select of radio button 7. Design a registration form using all controlsarrow_forward
- Python questionarrow_forwardQUESTION 3 3| Bachelor of Engineering (a) The length of a month varies from 28 to 31 days. In this task you are required to create a program that reads the name of a month from the user as a string. Then your program should display the number of days in that month. Display '28 or 29 days' for F'ebruary so that leap years are addressed. (b) A triangle can be classified based on the lengths of its sides as equilateral. isosceles or scalene. All 3 sides of an equilateral triangle have the same length. An isosceles triangle has two sides that are the same lengths and a third side that is a different length. If all of the sides have different lengths then the triangle is scalene. Write a program that reads the lengths of 3 sides of triangles from the user. Display a message indicating the type of the triangle. f(r) = ar? - lr - e (c) A univariate quadratic function has the form: where a, b and e are constants, and a is non-zero. The roots of a quadratic function can be found by finding the…arrow_forwardQ3. Write an algorithm and draw a flow chart to get student level and CGPA as input and check if student level is "Diploma Second Year" and CGPA is more than equal to 2.5 eligible display "Eligible for Advance Diploma" otherwise display "Not Eligible for Advance Diploma". If Student Level is "Advanced Diploma" and CGPA is more than equal to 2.75 then Display "Eligible for Bachelor" otherwise Display "Not Eligible for Bachelor"arrow_forward
- Pythonarrow_forwardWrite a program to input name and marks in 5 subjects. Calculate the total and grade. Display name, total, percentage and grade where grade will follow the given criteria. Percentage >95 “Excellent” , from 85 to 94 “Very Good” , from 75 to 84 “Good” from 65 to 74 “Satisfactory” less than <64 “Try again”.arrow_forwardRevise the program to keep track of loyalty points for three customers: A. B. and C. When a customer makes a purchase, two lines will be read: • A string: "A". "B". or "C". indicating which customer made the purchase • A float value indicating how much the customer paid, in dollars The line "nobody" indicates that there are no more purchases left and the program should end. The loyalty program requirements are: • When a customer makes a purchase totaling S10.00 or more, they get one loyalty point • When a customer passes six loyalty points, their total resets to one point No customer should gain or lose loyalty points due to another customer's purchase You can make any changes you like to the program or to the function to meet these goals. p6.cpp O O New 1 minclude 2 using namespace std; 3. 4 int points 6- void updateloyaltyCard( { points+; 7. 10- int main() { int customerAPoints int customerBPoints int customerCPoints = 0; string customer; float purchase; bool looping while (looping)…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