Starting from:
$30

$24

HW0: Hello World Solution

Summary




Basic C++ works much like other programming languages without having to use headers or pointers. This homework is an exercise to get you started on the basics of using C++ variables, expressions, functions, operators, loops, and conditionals.




Skills Expected




Basic C++



Assignment Description (and grading criteria)




Write a program that calculates the power given the base number and power to calculate (up to a reasonable amount – explain your reasoning in a comment) e.g. base = 2, power = 5 à 2 ^ 5 = 32




(1 Point) Obtain a base number and power to calculate from user



(2 Points) Handle negative and positive base numbers



(2 Points) Handle negative, zero, and positive powers



(2 Points) Allow user to continue calculating powers (base number 0 to exit program)



(1 Point) Block comment at the top of the main function with a brief description of what you’d like to see technology do in the future (e.g. “I want an Iron Man Suit!”)



(1 Point) At least one in-line or single-line comment with a brief description of what the statement does



(1 Point) Descriptive variable names

More products