Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Problem #1: Boudreaux Needs Math Help Issue: Boudreaux is not very good at math.

ID: 3621432 • Letter: P

Question

Problem #1: Boudreaux Needs Math Help
Issue:
Boudreaux is not very good at math. He needs you to make him figure out what the
factorial function does in math. For example: he is given the problem 3! and needs to
know that the answer is 6. He would also like to see the steps to the math function laid out so he can learn it.
Specifications:
Create a file named BoudreauxsFactorialTutor.java. Take as input an integer
representing the integer value to use in the Factorial. With that input, use a do/while or while loop to compute the factorial value and to create an output statement that will show the products of the numbers 1 through the input value. Produce the output statement using the same loop you use to find the value of the factorial.
Factorial: The product of all integers in sequence from 1 to n
Example: 7! = 1*2*3*4*5*6*7 = 5040
HINT
• Have a string variable to hold the output of what you want to display to the user.
• In your loop use the += concatenation shortcut for a string to build the output
string. You will concatenate “number *” to the string to create the output as
below.
• There is a special condition in your loop that if the loop is in its last iteration then
the concatenation should be just “number” not “number *”
Program Help:
• A message should be displayed if a negative number is entered explaining you
want only a positive integer.
• The output should be similar to the following output.

Problem #2: Boudreaux’s Bill Payer
Issue:
Boudreaux needs help paying his bills each month. He would like you to create a
program that asks him the date for which bills are due. Then it asks how many bills
Boudreaux has due that day. From there he would like to enter the bill amount for each of those bills. After he finishes giving the bill amounts he would like an itemized receipt so he can print it for his records. Boudreaux is trying to be good with his money.
Specifications:
Create a file named BoudreauxsBillPayer.java. This program should ask for a bill due
date using either a message box or scanner. After asking for the date the program will
then ask for how many bills are due that day. The user should be told they have a
maximum of five bills they can enter for one day. Using this information, the user will be able to enter each bill one at a time. After the last bill is entered, display an itemized list of the bills paid for that day. This list should include the due date, all the bill amounts and then a total for the day. The user should then be prompted to enter another date or exit.
Program Help:
• The solution to this problem requires nested loops. The outer loop can be a while
or do/while loop and the inner loop should be a for loop.
• Make sure the user entered a valid quantity of bills. There should be no less than
1 and no more than 5 bills entered. If they enter in an invalid number, tell them
and then return to the quantity of bills prompt.
• Assume the user will enter a proper bill amount. They won’t try to use characters
or something like 11.567.
• When the due date prompt is displayed, the user should also be given the option
to exit by typing in either an ‘E’ or ‘e’.
o HINT: use the stringVariable.charAt(0) function to achieve this.

Explanation / Answer

Dear, Here is the code import java.lang.*; import javax.swing.JOptionPane; class BoudreauxsFactorialTutor { public static void main(String arg[]) { String output; int number,fact=1; String s1; s1=JOptionPane.showInputDialog("Enter Element to be searched:"); number=Integer.parseInt(s1); if(number
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote