PLEASE READ INSTRUCTIONS AND OUTPUT CAREFULLY THIS IS ONE QU
PLEASE READ INSTRUCTIONS AND OUTPUT CAREFULLY: THIS IS ONE QUESTION, EXERCISE 1 AND EXERCISE 2 ARE A PART OF THE SAME ASSIGNMENT AND TIMEINPUT.CPP RELATES WITH COURSEINFO.CPP. PLEASE HELP WITH BOTH EXCERSISES BECAUSE TIMEINPUT.CPP IS NEEDED TO COMPLETE COURSEINFO.CPP. ALSO PLEASE PROVIDE CODE OUTPUT TO ENSURE THERE ARE NO ERRORS THANKS FOR YOUR HELP!
(Exercise 1) Create -timelnput.cpp In this part of the lab, you will be creating your own Time structure to keep track of various times of the day. Your Time structure should contain 3 integer variables: one for the hour one for the minutes one for the seconds Your program will setup a start & end time for a lecture at the University. It will ask the user to enter the start time and the end time for the lecture, using the 24 hour format (HH:MM:SS). You need to check that the input produces a valid time: check if the string contains the right characters (i.e. two characters [0-9], a colon, etc.) check if the time entered makes sense (i.e. HR is 0-23, etc.... for instance, 33:79:99 does NOT make sense). If the time is incorrect, output an error message and exit the program. Once the user has entered two valid times, your program will output the start and end times in a 24 hour format. For those who are unfamiliar with 24 hour format, please see http://en.wikipedia.org/wiki/12-hour_clock Note: in order to receive full credit for this part of the lab, you MUST create a main program that defined the Time structure and the following two functions: getTimeFromUser: takes in a Time structure variable as a parameter, reads a string from user, checks to see if it is a valid 24 hour format, stores it inside the Time structure variable, and return true or false depending on whether or not the time is valid. Since the Time structure is not returned at the end of this function, you need to pass the reference (&) of the Time structure instead of the identifier ·Solution
a generation chief is in charge of booking the month to month creation levels
of a specific item for an arranging skyline of twelve months. For arranging purposes, the
administrator was given the accompanying data:
• The aggregate interest for the item in month j is dj , for j = 1, 2, . . ., 12. These could
either be focused on qualities or be founded on figures.
• The cost of creating every unit of the item in month j is cj (dollars), for j = 1,
2, . . ., 12. There is no setup/altered cost for generation.
• The stock holding cost per unit for month j is hj (dollars), for j = 1, 2, . . ., 12.
These are caused toward the end of every month.
• The creation limit for month j is mj , for j = 1, 2, . . ., 12.
The chief\'s undertaking is to create a generation calendar that minimizes the aggregate generation
furthermore, stock holding costs over this twelve-month arranging skyline.
To encourage the detailing of a direct program, the administrator chooses to make the accompanying
improving suppositions:
1. There is no underlying stock toward the start of the main month.
2. Units planned for creation in month j are quickly accessible for conveyance at
the start of that month. This implies as a result that the creation rate is vast.
3. Deficiency of the item is not permitted toward the end of any month.
To comprehend things better, let us consider the main month. Assume, for that month, the
arranged generation level equivalents 100 units and the request, d1, parallels 60 units. At that point, since
the underlying stock is 0 (Assumption 1), the closure stock level for the primary month
would be 0 + 100 60 = 40 units. Take note of that every one of the 100 units are quickly accessible for
conveyance (Assumption 2); and that given d1 = 60, one must deliver no under 60 units
in the main month, to dodge lack (Assumption 3). Assume facilitate that c1 = 15 and
h1 = 3. At that point, the aggregate cost for the primary month can be processed as: 15×100+3×40 = 1380
dollars.
Toward the begin of the second month, there would be 40 units of the item in stock,
what\'s more, the relating finishing stock can be processed comparably, in light of the underlying
stock, the planned creation level, and the aggregate interest for that month. The same
plan is then rehashed until the end of the whole arranging skyline.
1
We now continue with a direct programming (LP) plan of this issue.
The Decision Variables
The chief\'s assignment is to set a creation level for every month. Accordingly, we have twelve
choice factors:
xj = the creation level for month j, j = 1, 2, . . ., 12.
The Objective Function
Consider the main month once more. From the examination above, we have:
The generation cost measures up to c1x1.
The stock holding cost measures up to h1(x1 d1), accepting that the closure stock level,
x1 d1, is nonnegative.
Subsequently, the aggregate cost for the principal month breaks even with c1x1 + h1(x1 d1).
For the second month, we have:
The generation cost levels with c2x2.
The stock holding cost measures up to h2(x1d1+x2d2), expecting that the consummation stock
level, x1 d1 + x2 d2, is nonnegative. This takes after from the way that the beginning
stock level during the current month is x1 d1, the generation level during the current month is x2,
what\'s more, the interest during the current month is d2.
Consequently, the aggregate cost for the second month measures up to c2x2 + h2(x1 d1 + x2 d2).
Continuation of this contention yields that:
The aggregate creation cost for the whole arranging skyline measures up to
X
12
j=1
cjxj c1x1 + c2x2 + . . . + c12x12 ,
where we have presented the standard summation documentation (\"\" implies by definition).



