Kaye Keith C. Ruden
Machine Problem 3
Reducing Fraction to Lowest Term
Create a Python script that will reduce an input fraction to its lowest term.
Program Requirements:
1. Define a function that will check first if the input fraction is a VALID fraction.
2. Define a function that will split a VALID fraction and return a list that consists the numerator and denominator.
3. Define a function that will accept two parameters (numerator and denominator to determine the greatest common divisor.
4. Define a function that will accept two parameters (numerator, denominator) and will return the reduced fraction.
Sample Output 1:
Input a fraction: 4/6
Reduced fraction is 2/3
Make a class named Fruit with a data member to calculate the number of fruits in a basket. Create twoother class named Apples and Mangoes to calculate the number of apples and mangoes in the basket.Print the number of fruits of each type and the total number of fruits in the basket. c#
Write a program in c++ to implement the stack push 5 values (10,20,30,40,50,)in the stack them pops value and display the remaining stack value.
Construct a C++ program having base class Student consisting protected member’s student name, student reg, student branch and employee rno. Define a member function input() having void return type for initializing the above said data members. Use this class to create new class Result having data member subject name ,subject marks, total marks and grade that calculate the grade for each course by using marks range given below and print the grade of each course by defining member function output() with void return type. Total marks Grade Calcultion 95-100 ‘O’ 90-94 ‘A+’ 85-89 ‘A’ 80-84 ‘B+’ 70-79 ‘B’ 60-69 ‘C’ 40-59 ‘D’ <40 ‘E'
by CodeChum Admin
In life, good things take time.
Let's make a simple program that mirrors this beautiful idea where we ask the user for two integer inputs. The first one would represent the starting number and the second one would represent the next n integers after it.
For example, if the first number inputted is 2 and the second number inputted is 3, then the output would be 3, 4, 5 because these are the next 3 integers after 2.
Instructions:
Input
1. Starting integer
2. Number of integers
Output
Enter·starting·integer:·2
Enter·how·many·next·integers:·3
3·4·5When should you use a structure?Why?
A . An airline intends to extend its air fleet by purchasing three types of aircrafts, denoted by I, II and III respectively. The available budget is 5000 units. The three types have the following features:
l .costs 100 units, has a range of 6.000 km and the collision avoidance system range is 30 km;
II. costs 60 units, has a range of 4.200 km and the collision avoidance system range is 48 km;
III. costs 50 units, has a range of 2.800 km and the collision avoidance system range is 32 km;
Compute how many aircrafts from each type should be purchased such that
-the budget is not exceeded
-the mean flight range is maximized the mean of
-the collision avoidance system range is at least 40 km.
Q. Solve A using the backtracking algorithm.
How do the digestive system, circulatory system and respiratory system work together
Use a while loop to find the smallest integer n such that 3n is greater than 30000
Find the equation of the curve having y’ = 2x – 5 that passes through (5,4).