subject

Note: the exercise instructions here are long -- read them all carefully. if you see an internal scrollbar to the right of these instructions, be sure to scroll down to read everything.
write an arithmetic expression that calculates the average of 18 and 46.
you may already know that:
the average of two numbers is their sum divided by 2
the symbol for division is /, thus 10 divided by 5 is written as 10/5
division has higher arithmetic precedence than addition
parentheses 's) may be used to override precedence
thus, one correct solution would be:
(18+46)/2
try it-- enter the above solution and click the submit button!
even with an exercise as simple as taking the average of 18 and 46 it is still possible to make mistakes. for example:
we might forget to use parentheses:
18+46/2
or, we might use the wrong arithmetic operator:
(18-46)/2
try these and see the system feedback. also try entering some of your own incorrect answers, and see what you get.
again, what makes programming so interesting is that there are also many ways to be right. for example, we could reverse the 18 and 46 and still have a correct
(46+18)/2
one of the most essential components of all learning is experimentation. nowhere is this more true than in learning programming. students should be encouraged to experiment with solutions even after "getting it right".
having submitted a typical correct solution, a student might experiment with:
(18+46)/(3-1)

ansver
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 14:40, davidb1113
You begin your first day of responsibilities by examining the recent is security breach at gearup to get ideas for safeguards you will take. at gearup, criminals accessed the company's improperly-secured wireless system and stole customers' credit card information as well as employee social security numbers. what kind of computer crime did gearup face?
Answers: 3
image
Computers and Technology, 23.06.2019 14:30, ladawnrowles005
The option enables you to modify a slide element in most presentation applications.
Answers: 2
image
Computers and Technology, 24.06.2019 16:30, officialrogerfp3gf2s
Pressing the backspace key deletes the text to the of the insertion point. the left or the right?
Answers: 1
image
Computers and Technology, 24.06.2019 16:50, bella7524
7.23 main lab 7 - online shopping cart background this main lab extends the earlier prep lab "online shopping cart part 1". (you should save this as a separate project from the earlier prep lab). you will create an on-line shopping cart like you might use for your on-line purchases. the goal is to become comfortable with setting up classes and using objects. requirements this lab can be done individually or as pair programming. expanded itemtopurchase class (15 points) extend the itemtopurchase class as follows. we will not do unit testing in this lab so we will not be giving you the names of the member functions. create good ones on your own. create a parameterized constructor to assign item name, item description, item price, and item quantity (default values of "none" for name and description, and 0 for price and quantity). additional public member functions set an item description get an item description print the cost of an item - outputs the item name followed by the quantity, price, and subtotal (see example) print the description of an item - outputs the item name and description (see example) additional private data members a string for the description of the item. example output of the function which prints the cost of an item: bottled water 10 @ $1.50 = $15.00 example output of the function which prints the item description:
Answers: 1
You know the right answer?
Note: the exercise instructions here are long -- read them all carefully. if you see an internal s...

Questions in other subjects: