Question

In: Computer Science

Assignment 5: Roman Numerals Assignment 5 You must create an application that takes two integer values,...

Assignment 5: Roman Numerals Assignment 5

You must create an application that takes two integer values, adds them together, and then displays the result of that expression as a roman numeral.

Create a two Python scripts:

1. Name your first script roman_numerals.py

2. Name your second script user_input.py

3. The goal of this projects is to practice the principles of abstraction while adding in an element of selection. How much you abstract your code is up to you, but you will be graded on the level of abstraction you achieve with your code. It is suggested that you use the roman_numerals.py file to create functions that abstract any complexity of logic from your user_input.py file.

4. Between the two files, your application must have the following functionality

a. Prompt the user for two integer inputs between 1 and 5.

b. Validate that the number is between 1 and 5.

c. Convert the input values to the appropriate data types

d. Add the two numbers together.

e. If the value is greater than 10, inform the user that the value is too high.

f. If the value is less than 1, inform the user that the value is too low.

g. Display the roman numeral of the value of the added numbers.

Scoring

1. 15% - Compiles without errors

2. 5% - Prompt user for two numbers between 1 and 5

3. 10% - Add two numbers together

4. 10% - Validate the total number is between 1 and 10

5. 10% - Convert the total number to a roman numeral

6. 15% - Display the roman numeral in a message “The roman numeral of the total is ”

7. 20% - Level of abstraction achieved

8. 15% - Meaningful comments a. This includes your header block with your name at the top.

Solutions

Expert Solution

CODE IN PYTHON:

#taking input from the user
a = input("Enter two integers between 1 and 5(inclusive):")
a = int(a)
b = input()
b = int(b)
sum = a+b
#validating the input
if(sum>10):
print("The value is too high...")
elif(sum<1):
print("The value is too low...")
#displaying the respective Roman numeral of number
else:
if(sum==1):
print("The roman numberal of the total is I")
elif(sum==2):
print("The roman numberal of the total is II")
elif(sum==3):
print("The roman numberal of the total is III")
elif(sum==4):
print("The roman numberal of the total is IV")
elif(sum==5):
print("The roman numberal of the total is V")
elif(sum==6):
print("The roman numberal of the total is VI")
elif(sum==7):
print("The roman numberal of the total is VII")
elif(sum==8):
print("The roman numberal of the total is VIII")
elif(sum==9):
print("The roman numberal of the total is IX")
elif(sum==10):
print("The roman numberal of the total is X")

INDENTATION:

OUTPUT:


Related Solutions

Assignment: Create data file consisting of integer, double or String values. Create unique Java application to...
Assignment: Create data file consisting of integer, double or String values. Create unique Java application to read all data from the file echoing the data to standard output. After all data has been read, display how many data were read. For example, if 10 integers were read, the application should display all 10 integers and at the end of the output, print "10 data values were read" My issue is displaying how many integers were read and how many strings...
For this assignment, You will create a NodeJS application which takes a city name as an...
For this assignment, You will create a NodeJS application which takes a city name as an input in its pug template. using openweathermap API, you should get the weather of that particular city and displays that information to a new pug template. You should also store the results in a file in your directory. Following are the detailed requirements. Your application should start with a pug template (similar to HTML page) which has a form with an input field and...
Create a method that takes a HashMap<Integer, Integer> and returns the sum of the keys of...
Create a method that takes a HashMap<Integer, Integer> and returns the sum of the keys of the HashMap.
Write a function convert_date that takes an integer as a parameter and returns three integer values...
Write a function convert_date that takes an integer as a parameter and returns three integer values representing the input converted into days, month and year (see the function docstring). Write a program named t03.py that tests the function by asking the user to enter a number and displaying the output day, month and year. Save the function in a PyDev library module named functions.py A sample run for t03.py: Enter a date in the format MMDDYYYY: 05272017 The output will...
The variable x takes the values ​​from 1 to 100, with these values, create two lists,...
The variable x takes the values ​​from 1 to 100, with these values, create two lists, one where the prime numbers are stored in one, and another where the non-prime numbers are stored, indicate and print the result
Create a ValueGet() method that takes a linked list as input and an integer index and...
Create a ValueGet() method that takes a linked list as input and an integer index and returns the value stored in the node at that index position. Sample Input: 01->100->300->214, index = 2 Output: 300 At index 2 the node has a value of 300 give me the full code. Give the full code with c++
Create a CubesSum application that prompts the user for a non-negative integer and then displays the...
Create a CubesSum application that prompts the user for a non-negative integer and then displays the sum of the cubes of the digits.   b) Modify the application to determine what integers of two, three, and four digits are equal to the sum of the cubes of their digits.(Java Programming )
Create an application that checks whether an integer is an odd or even number. Welcome to...
Create an application that checks whether an integer is an odd or even number. Welcome to the Odd/Even Checker! Enter an integer: ten Error! Invalid integer. Try again. Enter an integer: 10.3 Error! Invalid integer. Try again. Enter an integer: 10 The number 10 is even. Continue? (y/n): Error! This entry is required. Try again. Continue? (y/n): y Enter an integer: 9 The number 9 is odd. Continue? (y/n): n Specifications: Create a version of the Console class presented in...
Database Application Development Project/Assignment Milestone 1 (part 1) Objective: In this assignment, you create a simple...
Database Application Development Project/Assignment Milestone 1 (part 1) Objective: In this assignment, you create a simple HR application using the C++ programming language and Oracle server. This assignment helps students learn a basic understanding of application development using C++ programming and an Oracle database Submission: This Milestone is a new project that simply uses what was learned in the SETUP. Your submission will be a single text-based .cpp file including your C++ program for the Database Application project/assignment. The file...
For this assignment you are required to create two loan amortization schedules. However, after you create...
For this assignment you are required to create two loan amortization schedules. However, after you create the first one, you can simply just copy and paste to add rows for the second schedule. Your directions are as follows: Create a loan amortization schedule using Excel for a $36,000 car loan that will be repaid over 60 months at an annual interest rate of 4.5%. What is your monthly payment? What is the total amount you have paid over the life...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT