A milk carton can hold 3.78 liters of milk. Each morning, a dairy farm ships cartons of milk to a local grocery store. The cost of producing one liter of milk is 0.38, and the profit of each carton of milk is 0.27.
Write a program that does the following:
a. Prompts the user to enter the total amount of milk produced in the morning
b. Outputs the number of milk cartons needed to hold milk (Round your answer to the nearest integer.)
c. Outputs the cost of producing milk
d. Outputs the profit for producing milk
You are given an array of N non-negative integers: A1, A2, ..., AN. An alternating subsequence is a subsequence in which the indices of any two consecutive elements differ by exactly two in the original array. That is, if Ai1, Ai2, ..., Aik is some subsequence, then for it to be an alternating subsequence, (i2 - i1 = 2), (i3 - i2 = 2), and so on should all hold true. Among all alternating subsequences, find the one which has maximum sum of elements, and output that sum.
An egg distribution company uses different sizes of packings for eggs, that is, 30 eggs packing, 24 eggs packing, 18 eggs packing, 12 eggs packing and 6 eggs packing. Write a program which prompts user to enter total number of eggs (input validation is always must) to be packed and then calculate how many packings of each size will be possible. Also tell if there will be any eggs left to be packed.
write a prgram to print columns in rows without space in python?
1st input:
3
Not you kid
They are got
Like great
output
NotTheyLike
youaregreat
kidgot
2nd input
4
hy hy
by
hy hy hy
by by hy by hy
output:
hybyhyby
hyhyby
hyhy
byhy
You are given a binary compass which shows the direction you are safe to go to.
The binary compass read n binary digits (bits) which interprets 1 to rotate 90°
to
the left and 0 rotate 90°
to the right. Initially you are facing North. Create a program
for this binary compass.
User-defined function can be defined as a function written by the programmers to accomplish certain specific tasks.
(a) List down the FOUR (4) types of user-defined function.
(b) Write the function prototype for each of the following user-defined functions:
i. Function calcPower() that receives the voltage and current of type double. This function will return a value to calling function.
ii. Function DisplayWelcome() that does not receives any values and does not return a value.
M
iii. Function triangleArea() that receives the height and the base of a triangle of type float. This function will not return any value to calling function.
Write a menu driven program which has the following options:
1. Factorial of a number
2. Prime or not
3. Odd or Even
4. Exit
Make a program that prints out the first 8 multiples of a given integer y. Please use
for loop
While purchasing certain items, a discount of 10% is offered if the quantity
purchased is more than 1000. If quantity and price per item are input through the
keyboard, write a program and a flowchart to calculate the total expenses.
Write SQL statements for the following.
● Provide screenshots of your answers. Copy and paste your screenshots
below each item
Create a database named Library.
2. Create tables with appropriate integrity constraints:
● Authors
o AuthorID – Primary Key, 5 characters
o AuthorName –30 characters
o Nationality – 20 characters
● Books
o BookID – Primary Key, 5 characters
o AuthorID – Foreign Key related to Authors
o BookTitle – 50 characters
o Genre – 30 characters
o YearPublished – year