Roman Numeral Converter
The Roman Numeral Converter Problem
Create an application that allows the user to enter an integer between 1 and 10 into a text box on a form similar to the one shown in Figure 4-34. Use a Select Case statement to identify which Roman numeral is the correct translation of the integer. Display the Roman numeral in a Label control. If the user enters an invalid value, display an appropriate error message and do not attempt the conversion. Include an Exit button that closes the window.
Figure 4-34 Roman Numeral Converter form
The following table lists the Roman numerals for the numbers 1 through 10.
Input validation: Do not accept a number less than 1 or greater than 10. If the user enters a number outside this range, display an error message.
Want to see the full answer?
Check out a sample textbook solutionChapter 4 Solutions
Starting Out With Visual Basic, Student Value Edition (8th Edition)
Additional Engineering Textbook Solutions
Introduction to Java Programming and Data Structures, Comprehensive Version (11th Edition)
Starting Out with Java: Early Objects (6th Edition)
Problem Solving with C++ (10th Edition)
Starting Out with C++: Early Objects (9th Edition)
Web Development and Design Foundations with HTML5 (8th Edition)
C How to Program (8th Edition)
- Tuition Increase At one college the tuition for a full-time student is $6000 per semester. It has been announced that the tuition will increase by 2 percent each year for the next five years. Create an application with a loop that displays the projected semester tuition amount for the next 5 years in a ListBox control.arrow_forwardTo save a value in a control's property, you use a(n) in code.arrow_forwardCalories Burned Running on a particular treadmill, you burn 3.9 calories per minute. Create an application that uses a loop to display the number of calories burned after 10, 15, 20, 25, and 30 minutes. Display the output in a ListBox control. Tuition Increasearrow_forward
- If you know a vehicle’s speed and the amount of time it has traveled, you can calculate the distance it has traveled as follows:Distance = Speed × TimeFor example, if a train travels 40 miles per hour for 3 hours, the distance traveled is 120 miles. Create an application with a form. The user enters a vehicle’s speed and the number of hours traveled into text boxes. When the user clicks the Calculate button, the application should use a loop to display in a list box the distance the vehicle has traveled for each hour of that time period.arrow_forwardKinetic Energy In physics, an object that is in motion is said to have kinetic energy. The following formula can be used to determine a moving object’s kinetic energy: KE =1/2mv2 In the formula KE is the kinetic energy, m is the object’s mass in kilograms, and v is the object’s velocity in meters per second. Create an application that allows the user to enter an object’s mass and velocity and then displays the object’s kinetic energy. The application should have a method named KineticEnergy that accepts an object’s mass (in kilograms) and velocity (in meters per second) as arguments. The method should return the amount of kinetic energy that the object has.arrow_forwardRunning on a particular treadmill, you burn 3.9 calories per minute. Create an application that uses a loop to display the number of calories burned after 10, 15, 20, 25, and 30 minutes. Display the output in a ListBox control.arrow_forward
- نقطة واحدة Keywords in Visual Basic are * words that are used as prefixes for control names (such as text, btn, LBL, and Ist). is used to name controls, such as TextBox1, Command2, etc. should be used Find when naming variables. have special meaning and should not be used Find when naming variables. هذا السؤال مطلوب نقطة واحدة The default property for a text box control is Enable O Text Multiline Password char Oarrow_forwardRandom Number Guessing Game Create an application that generates a random number in the range of 1 through 100 and asks the user to guess what the number is. If the user’s guess is higher than the random number, the program should display “Too high, try again.” If the user’s guess is lower than the random number, the program should display “Too low, try again.” If the user guesses the number, the application should congratulate the user and then generate a new random number so the game can start over. Optional Enhancement: Enhance the game so it keeps count of the number of guesses that the user makes. When the user correctly guesses the random number, the program should display the number of guesses.arrow_forwardSales Tax and Total Create an application that allows the user to enter the amount of a purchase. The program should then calculate the state and county sales tax. Assume the state sales tax is 4 percent and the county sales tax is 2 percent. The program should display the amount of the purchase, the state sales tax, the county sales tax, the total sales tax, and the total of the sale (which is the sum of the amount of purchase plus the total sales tax).arrow_forward
- 1. Sum of NumbersCreate an application that displays a form similar to the one shown in Figure 5-44. When the Enter Numbers button is clicked, the application should display the input box shown in Figure 5-45.The input box asks the user to enter a positive integer value. Notice that the default input value is 10. When the OK button is clicked, the application should display a message box with the sum of all the integers from 1 through the value entered by the user Value - 5 10 20 100 sum 15 55 210 5050 starting with visual basic edition 8 chapt 5 #1arrow_forwardProperty Tax If you own real estate in a particular county, the property tax that you owe each year is calculated as 64 cents per $100 of the property’s value. For example, if the property’s value is $10,000, then the property tax is calculated as follows: Tax = $10,000 ÷ 100 × 0.64 Create an application that allows the user to enter a property’s value and displays the sales tax on that property.arrow_forwardPaint Job Estimator A painting company has determined that for every 115 square feet of wall space, 1 gallon of paint and 8 hours of labor will be required. The company charges $20.00 per hour for labor. Create an application that allows the user to enter the square feet of wall space to be painted and the price of the paint per gallon. The program should display the following data: • The number of gallons of paint required • The hours of labor required • The cost of the paint • The labor charges • The total cost of the paint jobarrow_forward
- Programming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage Learning