21 menu.py ogram that asks the user to input an integer value (n) and displays the following menu: - Enter An integer Value : 1.Factorial of n 2.Sum of values from 1 ton 3.Multiplication table of n Enter Your Choice Then allow the user to enter his option ( 1,2,3) so that> • i the user enters the value 1 then your program should calculate and display the factorial of n. • f the user enters the value 2 then your program should calculate the sum of values from 1 to n. • i the user enters the value 3 then your program should display the multiplication table for the value n. • H the user enters any other value then show the message "Invalid OptionTry again"

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter6: Looping
Section: Chapter Questions
Problem 1GZ
icon
Related questions
Question
2) menu.py
ogram that asks the user to input an integer value (n) and displays the following menu: -
4 من 4
Enter An integer Value : ..
1.Factorial of n
2.Sum of values from 1 to n
3.Multiplication table of n
Enter Your Choice .
Then allow the user to enter his option (1,2,3) so that :-
• the user enters the value 1 then your program should calculate and display the factorial of n.
If the user enters the value 2 then your program should calculate the sum of values from 1 to n.
If the user enters the value 3 then your program should display the multiplication table for the value
n.
If the user enters any other value then show the message "Invalid Option.Try again"
•
YOUR INPUT AND OUTPUT SHOULD BE AS THE FOLLOWING SAMPLE:-
Enter any integer value :5
1.Factorial of 5
2.Sum of values from 1 to 5
3.Multiplication table of 5
Enter your choice :1
Factorial of (5)=120
Enter any integer value :6
1.Factorial of 6
2.Sum of values from 1 to 6
3.Multiplication table of 6
Enter your choice :2
Sum of values from 1 to 6 =21
Enter any integer value :8
1.Factorial of 8
2.Sum of values from 1 to 8
3.Multiplication table of 8
Enter your choice :3
Multiplication table for (8)
1*8-8
2*8-16
3*8-24
4*8-32
5*8-40
6*8=48
7*8-56
8*8=64
9*8=72
10*8-80
11*8=88
12*8=96
A Marking Criteria
Category
Completeness and correctness (see the matrix below]
Code Layout
1if consistent layout and use of proper indentation and separation between different parts of
code Oif nat using proper indentation or the layout is not comistent
Max
6
1
Code Comments
1if using comments in the begining of each source file and using comments to explain the
code Oif not using comments
Code Identifiers and Variable Names
1if all identifiers are meaningful and helpful (eg, num_of_students)
Oif some identifiers are short or mileading (e, not capitalizing named constants)
Output Organization and Formatting
1if the autput is spelt correctly, organized, aligned, and formatted for masimum readability by the user.
Oif the autput is not clear, not aligned, or difficut to understand because of unclear instruction and speling errors
1
1
1
Table 1: Marks breakdown
Fully
Almost Half
Mostly All
correct correct wrong
3
correct
wrong
Fully completed
Almost completed
Half completed
Slight evidence of progress 2
Noise or all irrelevant
5
4
3
6
4
4
3
1
3
2.
2
1
4
2
1
1
Table 2: Correctness Matrix
B Academic Integrity
In case an accusation of cheating during a quiz or an examination is proven, the following
will be imposed:
Disciplinary Action for Cheating Case/s:
• First Offense (Zero Mark).
• Second Offense (Dismissal from the College).
END OF THE ASSIGNMENT
Transcribed Image Text:2) menu.py ogram that asks the user to input an integer value (n) and displays the following menu: - 4 من 4 Enter An integer Value : .. 1.Factorial of n 2.Sum of values from 1 to n 3.Multiplication table of n Enter Your Choice . Then allow the user to enter his option (1,2,3) so that :- • the user enters the value 1 then your program should calculate and display the factorial of n. If the user enters the value 2 then your program should calculate the sum of values from 1 to n. If the user enters the value 3 then your program should display the multiplication table for the value n. If the user enters any other value then show the message "Invalid Option.Try again" • YOUR INPUT AND OUTPUT SHOULD BE AS THE FOLLOWING SAMPLE:- Enter any integer value :5 1.Factorial of 5 2.Sum of values from 1 to 5 3.Multiplication table of 5 Enter your choice :1 Factorial of (5)=120 Enter any integer value :6 1.Factorial of 6 2.Sum of values from 1 to 6 3.Multiplication table of 6 Enter your choice :2 Sum of values from 1 to 6 =21 Enter any integer value :8 1.Factorial of 8 2.Sum of values from 1 to 8 3.Multiplication table of 8 Enter your choice :3 Multiplication table for (8) 1*8-8 2*8-16 3*8-24 4*8-32 5*8-40 6*8=48 7*8-56 8*8=64 9*8=72 10*8-80 11*8=88 12*8=96 A Marking Criteria Category Completeness and correctness (see the matrix below] Code Layout 1if consistent layout and use of proper indentation and separation between different parts of code Oif nat using proper indentation or the layout is not comistent Max 6 1 Code Comments 1if using comments in the begining of each source file and using comments to explain the code Oif not using comments Code Identifiers and Variable Names 1if all identifiers are meaningful and helpful (eg, num_of_students) Oif some identifiers are short or mileading (e, not capitalizing named constants) Output Organization and Formatting 1if the autput is spelt correctly, organized, aligned, and formatted for masimum readability by the user. Oif the autput is not clear, not aligned, or difficut to understand because of unclear instruction and speling errors 1 1 1 Table 1: Marks breakdown Fully Almost Half Mostly All correct correct wrong 3 correct wrong Fully completed Almost completed Half completed Slight evidence of progress 2 Noise or all irrelevant 5 4 3 6 4 4 3 1 3 2. 2 1 4 2 1 1 Table 2: Correctness Matrix B Academic Integrity In case an accusation of cheating during a quiz or an examination is proven, the following will be imposed: Disciplinary Action for Cheating Case/s: • First Offense (Zero Mark). • Second Offense (Dismissal from the College). END OF THE ASSIGNMENT
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Mathematical functions
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,