Question: solve for programming in c++ Lab 2.11.2 Times and durations Objectives Improve the student's skills in: using and declaring structured data types and variables; .

solve for programming in c++


Lab 2.11.2 Times and durations Objectives Improve the student's skills in: using and declaring structured data types and variables; . formatting output data. Scenario We hope that your previous program enables you to travel in time smoothly and accurately. Now we want you to modify it a bit: declare two structure variables-one for the start time, another for the end time; . Ask your user for both times - be sure that the end time denotes a later time of day than the start time (we assume that both times fall on the same day): e evaluate and output the duration of time (in hours and minutes) between both times. Note: we're still using a 24-hour clock! Test your code using the data we've provided. Example input 23 59 Example output Lab 2.11.1 Structure of time or time of structure Objectives Familiarize the student with: e declaring structured data types; decaring structured variables; e e referring to a structure's fields. Scenario We've shown you how to dec lare structures intended to store information about dates. Now we encourage you to dec lare a structure for handling the time of day with an accuracy of one minute. We think your structure will have two fields, but we don't want to suggest anything more- all the design decisions are up to you After you've done that, declare a variable of the previously declared structure type and write a code asking your user for two values: hours and minutes. Note: you should use a 24-hour clock, sometimes referred to as "military time" Check the inputted values carefully-don't accept ideas ike 25.71; store the values in your structure variable Next, input an int value and assume that this is a number of minutes - let it be the duration of some event. Your task is to output a time of day (hours and minutes respectively) that will be shown on clocks immediately after our event; try to show it in the form "HH:MM Test your code us ing the data we've provided. Example input 58 23 Lab 3.2.1 Vectors and pointers: first try Objectives Famiiarize the student with: declaring pointer variables; e assigning values to pointer variables . us ing incrementation to move the pointer through adjacent memory locations. Scenario Look at the code below. It doesn't look scary, right? Your task doesn't look scary either- you just have to find the smallest element in the vector. But there's one condtion - you mustn't use indexing In other words, using brackets in your code is strictly prohibited. Hint: You may use as many pointers as you wish. Forgive us that we don't show you any sample output. We would much rather see your code -it's much more interesting using namespace std; int main(void) ( int vector] 3, -5, 7, 10, -4, 14, 5, 2, -13 int nsizeof(vector) / sizeof(vector(e)); return 8
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
