Question: Hello there , I need help with my assignment , please follow steps & clear answers . COMP 1900-Fall 2018 Lab 4: Basic Loops (15
COMP 1900-Fall 2018 Lab 4: Basic Loops (15 pts) Number of People: Individual Duc: By the end of your lab session today. You MUST submit this before leaving the lab. Grader: Please refer to the COMP 1900 syllabus for your lab TA. Questions about grading? Contact him/her first Coding Style: Use camelCase for variable names, use consistent indentation in your code, and include a reasonable amount of comments throughout your code. The TAs may deduct points for poor coding style Within the 1900 folder on your desktop, create a new folder named Lab4. 1. (3 pts) Within your Lab4 folder, write a program named Powers-java that gets user input for two integers a and b, then computes and displays the value of a. You may assume that both a and b are non-negative. Sounds pretty easy, right? The catch here is that you cannot use Math.pow; instead, compute the by repeatedly multiplying axax... x a for b times. Your code should work for any non-negative values of a and b, including zero. (Remember that anything to the Oth power is 1.) result (4 pts) Within your Lab4 folder, write a program named Factorials.java that gets user input for an integer n, then computes and displays the value of n! You may assume that n is non-negative.n (pronounced "n factorial") is defined as nx (n-1)x (n-2)x..x 1. For example, 5! -5 x4x3x2x 2. 1 = 120. Your program should work for any reasonably small non-negative value of n, including zero (note that 0! has a value of 1). Factorials get large very quickly, so use the long data type to store your result. Problem 3 is on the back!)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
