Write a NEAR subroutine using 8086 assembly Language (with proper comments) that
returns the smallest byte value in a byte array of length 5-bytes. The array is declared in the
calling program and the base address of the array is passed to the subroutine in the stack. You
should write both the calling program and subroutine.
(Geometry: area of a pentagon) Write a program that prompts the user to enter the
length from the center of a pentagon to a vertex and computes the area of the pen-
tagon, as shown in the following figure.
3V3
The formula for computing the area of a pentagon is Area =
2
where s is
the length of a side. The side can be computed using the formula s = 2r sin
where r is the length from the center of a pentagon to a vertex. Here is a sample
run:
Enter the length from the center to a vertex: 5.5
The area of the pentagon is 108.61
JEnter
(Physics: find runway length) Given an airplane's acceleration a and take-of
speed v, you can compute the minimum runway length needed for an airplane to
take off using the following formula:
length
2a
Write a program that prompts the user to enter v in meters/second (m/s) and the
acceleration a in meters/second squared (m/s), and displays the minimum runway
length. Here is a sample run:
Enter speed and acceleration: 60, 3.5 LEnter
The minimum runway length for this airplane is 514.286 meters
(Sum the digits in an integer) Write a program that reads an integer between 0 and
1000 and adds all the digits in the integer. For example, if an integer is 932, the
sum of all its digits is 14. (Hint: Use the % operator to extract digits, and use the //
operator to remove the extracted digit. For instance, 932 % 10 = 2 and 932 //
10 = 93.) Here is a sample run:
Enter a number between 0 and 1000: 999 Enter
The sum of the digits is 27
(Average speed) Assume a runner runs 14 kılometers in 45 minutes and 30 sec-
onds. Write a program that displays the average speed in miles per hour. (Note that
1 mile is 1.6 kilometers.)
Write a program that calculates and displays a person’s body mass index (BMI). The BMI
is often used to determine whether a person with sedentary lifestyle is overweight or
underweight for his or her height. A person’s BMI is calculated with the following formula:
BMI = weight * 703/height2
where weight is measured in pounds and height is measured in inches. The program
should display a message indicating whether the person has optimal weight, is
underweight, or is overweight. A sedentary person’s weight is considered to be optimal
if his or her BMI is between 18.5 and 25. If the BMI is less than 18.5, the person is
considered to be underweight. If the BMI value is greater than 25, the person is
considered to be overweight. Use functions for this program. Implement those functions
in a separate header file.
Provide a method calculatePrice() that calculates and returns the price of this sandwich according to the rates given in the above table. E.g. the price of a sandwich with 3 bread slices, 2 cheese slices, 2 tomato slices, 3 patties, mustard, no ketchup, no ice berg with grilling will be calculated as 3 * 20 + 2 * 30 + 2 * 5 + 3 * 70 + 5+ 0 + 0 + 10 7. Provide a method applyDiscount(double disc) that calculates the price, applies the discount % given in the argument and returns the discounted price of the sandwich.E.g. if the method is called on a sandwich whose real price returned by the calculatePrice function is 550 and applyDiscount(10) is called, then a ten percent discount will be calculated as 550 * 10/100 = 55. Now this function will return the discounted price as 550 – 55 = 495. (Please note that this is just an example, do not hard code these values in your function).
An automobile travels at an average speed of 55 miles per hour for four hours. Draw a flowchart, write an algorithm and design a C++ program that computes and displays the distance driven, in miles that the car has travelled after 0.5, 1.0, 1.5 hours, and so on until the end of the trip.
A machine purchased for P28,000 is depreciated at a rate of P4,000 for seven years. Draw a flowchart, write an algorithm and design a C++ program that computes and displays in a suitably sized list box a depreciation table for seven years.
Draw a flowchart, write an algorithm and design a C++ program for an inventory system that will alert the user to reorder an item based on:
a. The stock-on-hand or an order is below the reorder print.
b. The item is not obsolete.
Use the selection structure.