Levels Tought:
Elementary,Middle School,High School,College,University,PHD
Teaching Since: | Jul 2017 |
Last Sign in: | 272 Weeks Ago, 5 Days Ago |
Questions Answered: | 1850 |
Tutorials Posted: | 1850 |
Graduate in Biology and Nutrition, MBA Finance
Florida State University
Aug-2000 - Jul-2007
Ass. Relationship Manager
Penn-Florida
Mar-2009 - Feb-2016
Write a program in java named PrimeFactorization that begins by reading in a series of positive integers on a single line of input and then computes and prints the product of those integers. Integers are accepted and multiplied until the user enters an integer less than 1. This final number is not part of the product. Then, the program prints the product. If the first entered number is negative or 0, the program must print “Bad input.” and terminate immediately. Next, the program determines and prints the prime factorization of the product, listing the factors in increasing order. If a prime number is not a factor of the product, then it must not appear in the factorization. Sample runs are given below. Note that if the power of a prime is 1, then that 1 must appear in the answer. Note: Your program’s prompt and output messages must conform to the following spelling and spacing
Enter integers: 882 18 26 -45
Product: 412776
Prime factorization: 2ˆ3 3ˆ4 7ˆ2 13ˆ1
Hel-----------lo -----------Sir-----------/Ma-----------dam----------- ----------- -----------Tha-----------nk -----------you----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------acq-----------uis-----------iti-----------on -----------of -----------my -----------pos-----------ted----------- so-----------lut-----------ion-----------.Pl-----------eas-----------e p-----------ing----------- me----------- on----------- ch-----------at -----------I a-----------m -----------on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I