Write a Java class Exercise1 that prompts for an integer and prints the number to the fourth power. A sample run is to be
Enter an integer: 3 3 ** 4 = 81where the user enters just the 3. For full credit, you must not use Math.pow because it is a very inefficient way to raise numbers to the power of small integers. Simply multiply the number by itself the right number of times. See
PyramidVolume.java
if you would like to review sample Java code doing simple input and output.
Part of this exercise is using the assignment submittal tool at https://esubmit.msoe.edu/. To access it, you must either be on campus or logged in to the campus VPN; see here for directions.
Once you are connected,
You can resubmit as many times as you like. We will grade just your final submission. If you have troubles submitting your code by the due date, do email the code to your instructor and explain what your problem is. But the expectation is that you will submit via esubmit, and your instructor is likely to respond by asking you to show them what happens when you try to use esubmit.
Your solution to this exercise (unlike labs) will be graded for correctness only. Documentation and style will not be graded. Submit your own solution, but feel free to talk to other students for this exercise (only!) if you are having problems.
Pay close attention to how your instructor asks you to submit your solutions. Generally you will submit code here and not submit any code to Canvas; your instructor will be able to grade your solution on the esubmit site. But there are cases in which students are asked to submit Zip files, documents, and/or paper printouts, and these are needed because different instructors have different grading workflows. Read submission requirements twice, and ask if there are parts that are not clear. Incorrect submissions slow down grading significantly.
If at all possible, the expectation is that you will match the expected
output exactly. This includes writing complete text lines to the
output. In Java terms, that means using System.out.println
instead of System.out.print
. Be sure to remove any debugging
output. If you have any differences shown - even if both outputs look the
same - then contact your instructor on removing those differencees if
you cannot find things to fix on your own.
A challenge you will face is that output appears differently in esubmit. Output that appears on multiple lines on your computer often appears on a single line in esubmit. This is because of the differences between typing text using your keyboard and reading the input from a file. You can ignore these differences. A writeup will give a sample session, and if you match the appearance of that session when you run the program on your machine, it should be fine in esubmit.
There are several advantages to using esubmit. A key one is the immediate feedback. Assuming you follow the coding standard (when appropriate - you don't need for this exercise!) and meet the design requirements in the writeup, you should get full credit on each assignment if you match the output.