No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
Given that input_time actually represents an integer value in seconds since the epoch - and has the value 0 at precisely "Thu Jan 1 00:00:00 1970", write a better implementation of this function. 1: unsigned long normalise(unsigned long input_time) 2: { 3: 4: bool finished; 5: 6: // This produces … |
|
Here are two sample tables of information which are used by a high school to keep track of the grades for its students. One table contains the names and addresses of the students, together with a student ID number. The second table contains the class name and class ID number, … |
|
What would happen when the code is run? a) As originally written? b) With the first bug fixed? 1: unsigned long normalise(unsigned long input_time) 2: { 3: 4: bool finished; 5: 6: // This produces a formatted time string like: 7: // Thu_Nov_24_18:22:48_1986 8: string str_time = format_time( input_time ); … |
|
Please write down any assumptions or deductions you make, and show all your calculations / workings, completing the task within 10 minutes (guide time). What initial values of a and c are required such that the final values of a and b are: a = 32, b = 4 int … |
|
[code=cplusplus] unsigned long normalise(unsigned long input_time) { bool finished; // This produces a formatted time string like: // Thu_Nov_24_18:22:48_1986 string str_time = format_time( input_time ); while( str_time.substr(1,3) != "Sun") { input_time -= 24*60*60; str_time = format_time( input_time ); } while( str_time.substr(11,2) != "00" ) { input_time -= 60*60; str_time = … |
|
1: unsigned long normalise(unsigned long input_time) 2: { 3: 4: bool finished; 5: 6: // This produces a formatted time string like: 7: // Thu_Nov_24_18:22:48_1986 8: string str_time = format_time( input_time ); 9: 10: while( str_time.substr(1,3) != "Sun") 11: { 12: input_time -= 24*60*60; 13: str_time = format_time( input_time ); … |