Question: Exercise 1 ( 3 0 points ) Source code: #input a float value for variable a here #input a float value for variable b here
Exercise points Source code: #input a float value for variable a here #input a float value for variable b here #output the results of addition, subtraction, multiplication and division print Thats all, folks!" Your task is to complete the code in order to evaluate the results of four basic arithmetic operations. The results have to be printed to the console. You may not be able to protect the code from a user who wants to divide by zero. That's okay, don't worry about it for now. Test your code does it produce the results you expect? Exercise points Source code: x float input Enter value for x: # put your code here print yy Complete the code in order to evaluate the following expression: The result has to be assigned to y Be careful! Watch the operators and keep their priorities in mind. Don't hesitate to use as many parentheses as you need. You can use additional variables to shorten the expression but it's not necessary Test your code carefully! Exercise points Source code: hour int input Starting time hours: mins intinput Starting time minutes: dura int input Event duration minutes: # put your code here Your task is to prepare a simple code able to evaluate the end time of a period of time, given as a number of minutes it could be arbitrarily large The start time is given as a pair of hours and minutes The result has to be printed to the console. For example, if an event starts at : and lasts minutes, it will end at : Don't worry about any imperfections in your code it's okay if it accepts an invalid time the most important thing is that the code produces valid results for valid input data. Test your code carefully! Hint: using the operator may be the key to success! Example input Example output : Example input Example output : Example input Example output : Exercise points Source code: #input a float value for variable a here #input a float value for variable b here #output the results of addition, subtraction, multiplication and division print Thats all, folks!" Your task is to complete the code in order to evaluate the results of four basic arithmetic operations. The results have to be printed to the console. You may not be able to protect the code from a user who wants to divide by zero. That's okay, don't worry about it for now. Test your code does it produce the results you expect? Exercise points Source code: x float input Enter value for x: # put your code here print yy Complete the code in order to evaluate the following expression: The result has to be assigned to y Be careful! Watch the operators and keep their priorities in mind. Don't hesitate to use as many parentheses as you need. You can use additional variables to shorten the expression but it's not necessary Test your code carefully! Exercise points Source code: hour int input Starting time hours: mins intinput Starting time minutes: dura int input Event duration minutes: # put your code here Your task is to prepare a simple code able to evaluate the end time of a period of time, given as a number of minutes it could be arbitrarily large The start time is given as a pair of hours and minutes The result has to be printed to the console. For example, if an event starts at : and lasts minutes, it will end at : Don't worry about any imperfections in your code it's okay if it accepts an invalid time the most important thing is that the code produces valid results for valid input data. Test your code carefully! Hint: using the operator may be the key to success! Example input Example output : Example input Example output : Example input Example output :
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
