While experimenting with coding sequences, you decide to try a modification of the factorial sequence by calculating the product of consecutive odd integers instead of all consecutive integers. You call this sequence OFact. The first four values of the OFact sequence are:
OFact (1) = 1
OFact (2) = 1*3=3
OFact (3) = 1*3*5=15
OFact (4) = 1*3*5*7=105
Write a program that will ask the user for a maximum sequence value desired, and then print the OFact sequence to the command window as long as the value calculated does not exceed the maximum value entered by the user. For example, if the user specifies a maximum of 100. It would print the first three values since QFact(4) = 105 > 100. This should be printed in two columns: N in the first column and OFact(N) in the second column. All values generated should be stored in the
When the program reaches the maximum value, a message should be printed that states:
Where XXX is the maximum entered by the user, Y is the sequence number of the calculated value, and ZZZ is the last calculated value.

Want to see the full answer?
Check out a sample textbook solution
Chapter 19 Solutions
THINKING LIKE AN ENGINEER W/ACCESS
- Auto Controls Hand sketch the root Focus of the following transfer function How many asymptotes are there ?what are the angles of the asymptotes?Does the system remain stable for all values of K NO COPIED SOLUTIONSarrow_forward-400" 150" in Datum 80" 90" -280"arrow_forwardUsing hand drawing both of themarrow_forward
- A 10-kg box is pulled along P,Na rough surface by a force P, as shown in thefigure. The pulling force linearly increaseswith time, while the particle is motionless att = 0s untilit reaches a maximum force of100 Nattimet = 4s. If the ground has staticand kinetic friction coefficients of u, = 0.6 andHU, = 0.4 respectively, determine the velocityof the A 1 0 - kg box is pulled along P , N a rough surface by a force P , as shown in the figure. The pulling force linearly increases with time, while the particle is motionless at t = 0 s untilit reaches a maximum force of 1 0 0 Nattimet = 4 s . If the ground has static and kinetic friction coefficients of u , = 0 . 6 and HU , = 0 . 4 respectively, determine the velocity of the particle att = 4 s .arrow_forwardCalculate the speed of the driven member with the following conditions: Diameter of the motor pulley: 4 in Diameter of the driven pulley: 12 in Speed of the motor pulley: 1800 rpmarrow_forward4. In the figure, shaft A made of AISI 1010 hot-rolled steel, is welded to a fixed support and is subjected to loading by equal and opposite Forces F via shaft B. Stress concentration factors K₁ (1.7) and Kts (1.6) are induced by the 3mm fillet. Notch sensitivities are q₁=0.9 and qts=1. The length of shaft A from the fixed support to the connection at shaft B is 1m. The load F cycles from 0.5 to 2kN and a static load P is 100N. For shaft A, find the factor of safety (for infinite life) using the modified Goodman fatigue failure criterion. 3 mm fillet Shaft A 20 mm 25 mm Shaft B 25 mmarrow_forward
- Elements Of ElectromagneticsMechanical EngineeringISBN:9780190698614Author:Sadiku, Matthew N. O.Publisher:Oxford University PressMechanics of Materials (10th Edition)Mechanical EngineeringISBN:9780134319650Author:Russell C. HibbelerPublisher:PEARSONThermodynamics: An Engineering ApproachMechanical EngineeringISBN:9781259822674Author:Yunus A. Cengel Dr., Michael A. BolesPublisher:McGraw-Hill Education
- Control Systems EngineeringMechanical EngineeringISBN:9781118170519Author:Norman S. NisePublisher:WILEYMechanics of Materials (MindTap Course List)Mechanical EngineeringISBN:9781337093347Author:Barry J. Goodno, James M. GerePublisher:Cengage LearningEngineering Mechanics: StaticsMechanical EngineeringISBN:9781118807330Author:James L. Meriam, L. G. Kraige, J. N. BoltonPublisher:WILEY





