a. Declare a single structure data type suitable for a car structure of the type illustrated:
Car Number
Miles Driven
Gallons Used
25 1450 62
36 3240 136
44 1792 76
52 2369 105
68 2114 67
b. Using the data type declared for Exercise 2a, write a C++ program that inter-actively accepts the above data into an array of five structures. Once the data have been entered, the program should create a report listing each car number and a miles per gallon achieved by the car. At the end of the report include the average miles per gallon achieved by the complete fleet of cars.
The Harris–Benedict equation estimates the number of calories your body needs to maintain your weight if you do no exercise. This is called your basal metabolic rate, or BMR. The formula for the calories needed for a woman to maintain her weight is BMR = 655.1 + ( 9.563 × weight in kg ) + ( 1.850 × height in cm ) – ( 4.676 × age in years ) The formula for the calories needed for a man to maintain his weight is BMR = 66.5 + ( 13.75 × weight in kg ) + ( 5.003 × height in cm ) – ( 6.755 × age in years )
A typical chocolate bar will contain around 230 calories. Design an algorithm and write a program using switch case that allows the user to input his or her weight in kilograms, height in centimeters, age in years, and the character M for male and F for female. The program should then output the number of chocolate bars that should be consumed to maintain one’s weight for the appropriate sex of the specified weight, height, and age.
Create a class called Storage that a hardware store might use to the actual storage of the * store. * A storage should include the following information as instance variables: * a map of all the items that the storage has (type HashMap). The key * is item’s description * In addition, provide a method named getItemQuantity(String description) that returns the * item that is being searched if there is any in storage. If the item is found in storage * returns the ItemQuantity otherwise returns null * Provide a method addItemQuantity(Item, Number) that saves input items to the storage. This * method should take as inputs the Item and the quantity of item. It should be a void method and should add the item to storage map
Create a class called Item that a hardware store might use to represent a list of items * that a client may need. * A Item should include the following information as instance variables: * a part description (type String), * a part type of item (type String), * a part price (type double), * a part year of production (type int), * a part capacity of the item (type String), * a part processing (type String) * Your class should have a constructor that initializes the instance variables. * Provide a set and a get method for each instance variable.
Create a class called ItemQuantity to represent a item and the quantity * the quantity is a positive number.
Problem
This problem is related to the virtual learning environment application discussed in one theory session and a few practicals. In
this problem, you are tasked with creating and updating learner profiles, a particular type of user. As well, given a learner profile,
we would like to retrieve the learning materials in the form of topics. Note that the learning materials for a given course will differ
from one learner profile to another. For example, for a course "Distributed Systems and Applications", the learning materials for
a learner with a weak background in "Programming" compared o another learner profile with a stronger background in
programming.
Your task is to:
1. Provide a description in OpenAPI of the API that allows for communication between a client and a service for the
functionalities discussed above;
2. Implement a corresponding client and a service.