if a given integer in "N". write a program to print the right angled triangle pattern of "N" rows and there is a lhytopenus line using "/" of same number
-------
|
|
|
|
|
|
|
Q11: A travel company wants to fly a plane to the Bahamas. Flying the plane costs 5000 dollars. So far, 29 people have signed up for the trip. If the company charges 200 dollars per ticket, what is the profit made by the company?
Fill in values or arithmetic expressions for the variables below.
cost_of_flying_plane = ??? number_of_passengers = ??? price_of_ticket = ???
profit = ???
print('The company makes of a profit of {} dollars'.format(profit))
Q11b Out of the 29 people who took the flight, only 12 buy tickets to return
from the Bahamas on the same plane. If the flying the plane back also costs 5000 dollars, and does the company make an overall profit or loss? The company charges the same fee of 200 dollars per ticket for the return flight. (Optional)
Use an if statement to display the result.
Write a program with three functions that calculates the final purchase price after various promotions and sales tax are applied. All functions will use Pass by Reference to manipulate the total purchase price. The functions are described below:
Function #1 = Take 20% off the price
Function #2 = Take an addition $10 off ONLY if the current total is at least $50 (after function #1)
Function #3 = Apply 7% sales tax to the total after function #2
Output:
Enter the total price of your purchases: [user types: 100]
The final price of your purchase including all promotions and tax is: $74.90
Write a program with three functions that all use the same global constant. The global constant is the name of a video game: "Fun With Math 2". Each of the functions should output a message that contains this global constant. There is one intro message, one game-exit message, and one game completion message.
Output:
Welcome to Fun With Math 2
This program aims to improve your math skills via interactive games.
Thank you for playing Fun With Math 2
Remember to practice daily!
You have successfully completed all of the activities in Fun With Math 2
Be sure to look out for the 3rd edition of this game (Coming in Summer 2049)!
An owner of an auto repair shop wishes to organize his team of mechanics at the beginning of the day. To make the distribution of work equal, he organizes cars with an even amount of faults into bay 1 and cars with an odd amount of faults into bay 2. There are nine cars in total Write the pseudocode for the problem, then write a Java program to separate the even and odd number of car faults. Have all even numbers displayed first, then odd numbers at the end. The repairs required for each car are as follows. 18, 14, 12, 6, 4, 21, 19, 9, 3 Hint: WHILE LOOPS and IF.
Assign your name to the variable name.
Assign your age (real or fake) to the variable age.
Assign a boolean value to the variable has_android_phone.
Create a dictionary person with keys "Name", "Age", "HasAndroidPhone" and values using the variables defined above.
Use a for loop to display the type of each value stored against each key in person.
Create a rectangle class having length and width as parameter. Write getter/setter for
each parameter. Write default constructor that should initialize the default value to the
length and width.. Write member functions to calculate area and another function to
calculate perimeter in class. Write a function to print the information regarding rectangle
which include length, width, area and parameter.
Formula to calculate area = 0.5 * length * width
Formula to calculate perimeter=2 * length+ 2 * width
write a program to find the first prime number in the given inputs
What is the Network ID, Broadcast Address, First Usable IP, or Last Usable IP on the sub-network
that the node 192.168.1.15/26 belongs to?
A code is required to print all possible arrangement of combination of an array(of 'k' elements), i.e. the permutation of the result of combination.
Let's say the array has the following elements (k=4):
"alpha", "beta", "gamma", "delta".
Then, we choose r=3
The expected result is as follows:
alpha beta gamma
alpha gamma beta
beta alpha gamma
beta gamma alpha
gamma alpha beta
gamma beta alpha
alpha beta delta
alpha delta beta
beta alpha delta
beta delta alpha
delta alpha beta
delta beta alpha
alpha delta gamma
alpha gamma delta
delta alpha gamma
delta gamma alpha
gamma alpha delta
gamma delta alpha
beta delta gamma
beta gamma delta
delta beta gamma
delta gamma beta
gamma beta delta
gamma delta beta
From the above result above, all unique PERMUTATION of the COMBINATION of r=3 from the array of k=4 elements is completed.
This is confirmed since 4C3 x 3! = 24 lines of results