Questions: 11 448

Answers by our Experts: 10 707

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

Flow control is one of the main building blocks that determines how a program
should run. USA Cocoa company wishes to compare the impart of two newly acquired fertilizers on cocoa. They will do this by applying the same quantity of the two fertilizers on two similar but different cocoa plant under the same conditions (humidity, sunlight, moisture etc.). They will then choose the fertilizer whose crop produces the best harvest (highest qty per sq feet). As a programmer,

a. Suggest a flow control method that would be used to do the comparison
and explain the reason why you chose it.

b. Write a flow control statement that would do the comparison in “a” above.

c. The USA Statistical Services is interested in your statement in “b” above but it is of the view that it is too specific. They want you to modify it by creating a function that takes four arguments i.e. (the names of the two fertilizer and their individual yields). The function should return the name of the fertilizer with the greatest yield.

Static data members of a class occupy memory once whereas non static data members occupy members as per the number of objects created. Justify the statement by writing a program.


COVID-19 has triggered panic buying from Americans with the expectation that there will be declaration of lockdown after the closure of school across the
country. Retailer are increasing the prices of their goods on the shelf based on
the time it stays on the shelf. The management of “Brutus Stores” have decided on this price policy. The price of any item which is expected to sell within a week should be increased by 20%. However, if an item stays on the shelf after a week but less than or equal to two weeks the price should be increase by 15%.
The price of any other item that stays on the shelf for more than two weeks
should be increase by 2%. As a programmer you have been consulted to
develop a program that will:

a. Request for item name, current price in $, expected duration on shelf.

b. Compute the retail price of the item.

c. Display the results.

d. Explain your results
a. C++ is known to be an object-oriented program. Objects are also known
to exist in real life. You have been invited as a computer science student
to distinguish between real life objects and object found in object oriented
program OOP.

b. Write an OOP to compare the risk factor that will lead to high payment of
life insurance premium. The variables to consider are: age, weight, and
height
1. The program should request for the variables to be inputted from the
keyboard.

2. Premium should be high if age is greater than or equal to 60 years and
weight is greater than or equal 80kg and has greater than or equal 6.8 feet. Otherwise the premium should be low.

3. Critically explain how the program could be adopted by allied companies for their operations.

Write a program which displays a given character, n number of times, using a function. When the n value is not provided, it should print the given character 80 times. When both the character and n value is not provided, it should print ‘*’ character 80 times.

 By using default arguments


Static data members of a class occupy memory once whereas non static data members occupy members as per the number of objects created. Justify the statement by writing a program.




WAP which displays a given character, n number of times, using a function. When the n value is not provided, it should print the given character 80 times. When both the character and n value is not provided, it should print *’character 80 times. [Write the above program in two ways:- -using function overloading. -using default arguments.]



Create a class containing
-Create a dynamic 2d array according to size provided by user and an integer that keeps track of its size
-insert values until user presses - 2
-Create another bigger array when previous one is full
-copy all values in the new array and release the old memory print after each insert
-ask the user to delete numbers until he presses - 2
-find the index in the original array and then remove that index from the original array
-stop when array is empty of when user presses - 2
Write a bool function which deletes an element in the linked list
-bool delete_element(int a)
Another function which checks if the list is empty
-bool isempty()
Create a dynamic array and copy its contents to another array delete its elements until you press - 1 and find the index in original array and then remove it from the original array. Check when array is empty and print after each removal of element
LATEST TUTORIALS
APPROVED BY CLIENTS