Description: In the main program create a menu system that will allow a user to choose from 3 option. 1. Fraction calculator 2. Grading schema 3. Biggest integer
Program #1 Fraction calculator: You will start by prompting the user for two fractions in the main. The inputs should be two strings in the form #/#. You must account for both positive and negative numerators. Therefor -#/# is also a valid input. In a separate function create a program that will calculate the following. Addition, Subtraction, Multiplication and Division of the two fractions. Then display the results in a formatted table. All outputted fractions must be in lowest terms or whole numbers if possible.

========================================================
Program name FractionCalculator.java
========================================================
import java.util.Scanner;
public class FractionCalculator {
public static void main(String[] args) {
int ch;
Scanner sc = new
Scanner(System.in);
String fraction1="";
String fraction2="";
while (true) {
System.out.println("Menu");
System.out.println("1. Fraction Calculator");
System.out.println("2. Grading schema");
System.out.println("3. Biggest integer");
System.out.println("4. Exit");
System.out.print("Enter your choice: ");
ch =
sc.nextInt();
if(ch!=4)
{
System.out.print("Enter Fraction 1: ");
fraction1 = sc.next();
System.out.print("Enter Fraction 2: ");
fraction2 = sc.next();
}
switch
(ch) {
case
1:
//Calling function
fractionCalculator(fraction1, fraction2);
break;
case
2:
System.out.println("Implementation In
Progress");
break;
case
3:
System.out.println("Implementation In
Progress");
break;
case
4:
break;
default:
System.out.println("Invalid choice");
}
if(ch==4)
break;
}
System.out.println("Thank
you!");
}
public static void fractionCalculator(String fraction1, String fraction2) {
int numerator1,
numerator2;
int denominator1, denominator2;
String addResult;
String subResult;
String mulResult;
String divResult;
String fraction1Split[]
= fraction1.split("/");
String fraction2Split[] =
fraction2.split("/");
// Extract numerator and
denominator
numerator1 =
Integer.parseInt(fraction1Split[0]);
denominator1 =
Integer.parseInt(fraction1Split[1]);
// Extract numerator and
denominator
numerator2 =
Integer.parseInt(fraction2Split[0]);
denominator2 =
Integer.parseInt(fraction2Split[1]);
// Logic for fractional
calculation
addResult = (numerator1 *
denominator2 + numerator2 * denominator1)+ "/" + (denominator1 *
denominator2);
subResult = (numerator1 *
denominator2 - numerator2 * denominator1)+ "/" + (denominator1 *
denominator2);
mulResult = (numerator1 *
numerator2) + "/"+ (denominator1 * denominator2);
divResult = (numerator1 *
denominator2) + "/"+ (denominator1 * numerator2);
System.out.println("------------------------------");
System.out.println("Addition Result : " + addResult);
System.out.println("Substraction
Result : " + subResult);
System.out.println("Multiplication
Result : " + mulResult);
System.out.println("Division Result
: " + divResult);
System.out.println("------------------------------");
}
}
Description: In the main program create a menu system that will allow a user to choose...
Create a procedure driven program for performing arithmetic with fractions. Using a switch statement in main to perform the various actions. Similar to this; Menu a) Load/Reload first fraction b) Load/Reload second fraction c) Add two fractions and display answer d) Subtract two fractions and display answer e) Multiply two fractions and display answer f) Divide two fractions and display answer g) Exit Provide functions that allow for The reloading of the fractions. The addition of two rational numbers. The...
Design a calculator program that will add, subtract, multiply, or divide two numbers input by a user.Your program should contain the following:-The main menu of your program is to continue to prompt the user for an arithmetic choice until the user enters a sentinel value to quit the calculatorprogram.-When the user chooses an arithmetic operation (i.e. addition) the operation is to continue to be performed (i.e. prompting the user for each number, displayingthe result, prompting the user to add two...
Write a Python Program that displays repeatedly a menu as shown in the sample run below. The user will enter 1, 2, 3, 4 or 5 for choosing addition, substation, multiplication, division or exit respectively. Then the user will be asked to enter the two numbers and the result for the operation selected will be displayed. After an operation is finished and output is displayed the menu is redisplayed, you may choose another operation or enter 5 to exit the...
Task 2.5: A simple calculator (25 marks) In this task you will develop a MARIE program that implements four basic functions of a calculator: addition, subtraction, multiplication, division, and exponent. The program should be performing the user selected tasks (one of the mentioned mathematical operations) after the user enters one of the selection inputs, ‘a’, ‘s’, ‘m’, ‘d’ or ‘p’. Here, input ‘a’ selects addition process, ‘s’ selects subtraction process, ‘m’ selects multiplication process, ‘d’ selects division process, and ‘p’...
A Simple Calculator Summary: Write a console program (character based) to do simple calculations (addition, subtraction, multiplication and division) of two numbers, using your understanding of Java. Description: You need to write a program that will display a menu when it is run. The menu gives five choices of operation: addition, subtraction, multiplication, division, and a last choice to exit the program. It then prompts the user to make a choice of the calculation they want to do. Once the...
Write a program that performs the following: 1. Presents the user a menu where they choose between: a. Add a new student to the class i. Prompts for first name, last name ii. If assignments already exist, ask user for new student’s scores to assignments b. Assign grades for a new assignment i. If students already exist, prompt user with student name, ask them for score ii. Students created after assignment will need to...
C++ please no arrays! Create a program that will allow the user to enter up to 50 whole values and determine the number of values entered, how many of the values were odd and how many of the values were even. Your code should contain 2 functions, a main function and a function to enter the numbers enter and count the values. Your main function should be a driver program that will call another function to count the total number...
Develop a flowchart and then write a menu-driven C++ program that uses several FUNCTIONS to solve the following program. -Use Microsoft Visual C++ .NET 2010 Professional compiler using default compiler settings. -Use Microsoft Visio 2013 for developing your flowchart. -Adherence to the ANSI C++ required -Do not use <stdio.h> and <conio.h>. -Do not use any #define in your program. -No goto statements allowed. Upon execution of the program, the program displays a menu as shown below and the user is prompted to make a selection from the menu....
You have been developing a Fraction class for Teacher’s Pet Software that contains several fields and functions. a. Add four arithmetic operators, +, -, *, and /. Remember that to add or subtract two Fractions, you first must convert them to Fractions with a common denominator. You multiply two Fractions by multiplying the numerators and multiplying the denominators. You divide two Fractions by inverting the second Fraction, then multiplying. After any arithmetic operation, be sure the Fraction is in proper...
Your assignment is to create a restaurant ordering system where
the cashier can create the menu and then take in the order and
display the order back to the customer
Sample Execution – Level 1
Welcome to your Menu Creation system.
How many items would you like to have on your menu? 2
Create your menu!
Enter item #1: Coffee
Enter item #2: Tea
This is the menu:
Coffee
Tea
What would you like to order? Cake
That isn’t on...