Questions: 5 831

Answers by our Experts: 5 728

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

In this exercise you will create a program that computes the average of a collection of values entered by the user. The user will enter 0 as a sentinel value to indicate that no further values will be provided. Your program should display an appropriate error message if the first value entered by the user is 0.


Right angle triangle given an knteger n write a program to print a right angle triangle pattern|___

given an integer value N as input write a program to print a shaded diamond of 2 *N -1 rows using an asterisk characters

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:


Input a fraction: 4/6


Reduced fraction is 2/3

Reducing Fraction to Lowest Term


Create a Python script that will reduce an input fraction to its lowest term.


Program Requirements:


Function 1: Function that will check first if the input fraction is a VALID fraction:


Your answer:


Function 2: Function that will split a VALID fraction and return a list that consists the numerator and denominator.


Your answer:


Function 3: Function that will accept two parameters (numerator and denominator) to determine the greatest common divisor


Your answer:


Function 4: Function that will accept two parameters (numerator, denominator) and will return the reduced fraction:


Your answer:


Sample Output 1:


Input a fraction: 4/6


Reduced fraction is 2/3

a)         Method getData: This method reads and stores the data in the two-dimensional list.

 

b)         Method averageHigh: This method calculates and returns the average high temperature of the year.

 

c)         Method averageLow: This method calculates and returns the average low temperature of the year.

 

d)         Method indexHighTemp: This method returns the index of the highest temperature in the list.

 

e)         Method indexLowTemp: This method returns the index of the lowest temperature in the list.


Store the details of the following 3 flights in a 2-dimensional tuple:

Flight number Destination Departure time

EK004 London 12:30

EK012 Paris 14:00

EK052 Male 16:15

Create a function called checkFlightNumber which accepts a flight number as an input parameter. This function will check if the flight number is found in the tuple which contains the flight details and return TRUE of found or FALSE if it is not.

Your program should keep asking for passengers’ (loop)details until the user enters n to stop. The program should first ask for the passengers’ flight number and use the checkFlightNumber function to check if it is valid or not. If checkFlightNumber returns FALSE, your program will print an appropriate error message and ask the user to try again. However, if checkFlightNumber returns TRUE, your program should ask

the user to enter the following passenger details:

1.Name

2.Date of birth

3. Passport number


You are given on array a of n integers on which the followings operations can be performed





Pick an index i,0<= i<n.




Choose any integer p.




Replace a

Question



Convert the given word in to snaky conversion according to the number (N)




Example:-



Input



AWESOMENESS 4




Explanation:-



A. E



W. M. N



E. O. E. S



S. S




Output :-



AE



WMN



EOES



SS





String modifications given R= honey money

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS