## Are you sure?

This action might not be possible to undo. Are you sure you want to continue?

)

Note: BOLD underline denotes user’s input.

Question 1

Write a program to compute and print the volume of a sphere using the formula: You may use r*r*r to compute r3. Your program will prompt the user to enter a series of radius readings and the last value read is the sentinel 999 (i.e. to end input, the user has to type 999 as the last value). After that, it will display the corresponding volume in a neat format as shown in the output below. Your program should also calculate the total volume of all the spheres. Enter radius of sphere (999 to end): 2.3 radius volume 2.30 38.22 Enter radius of sphere (999 to end): 4.555 radius volume 4.55 296.90 Enter radius of sphere (999 to end): 0.999 radius volume 1.00 3.13 Enter radius of sphere (999 to end): 999 The total volume is 338.26

(Note: Your answers should be fixed to 2 decimal places, and your output should look exactly like the one shown above.

1

Question 2

Write a program to compute and print the area of a circle using the formula: You may use r*r to compute r2. Your program will prompt the user to enter a series of radius readings and the last value read is the sentinel 999 (i.e. to end input, the user has to type 999 as the last value). Check that the radius is greater than zero. (i.e. You may terminate the program if the radius is less than or equal to zero) After that, it will display the corresponding area in a neat tabular format as shown in the output below. Your program should also calculate the average area of all the circles. Enter radius of circle (999 to end): 4 radius area 4.00 50.27 Enter radius of sphere (999 to end): 2 radius area 2.00 12.57 Enter radius of sphere (999 to end): 999 The average area is 31.42

Enter radius of circle (999 to end): 2.66 radius area 2.66 22.23 Enter radius of sphere (999 to end): 4.789 radius area 4.79 7 2.05 Enter radius of sphere (999 to end): 0 Error!!! circle radius must be greater than zero

(Note: Your answers should be right up to 2 decimal places, and your output should look exactly like the one shown above.

2

Question 3

The reactance of a capacitor Xc is given by the formula: Where =2f. The frequency and capacitance of the capacitor are given by f and C, respectively. Write a program to prompt the user for the frequency, f and capacitance, C of a capacitor. Then calculate the respective reactance, Xc using the formula given above for 0.1f, 0.5f, f, 5f and 10f. Display the corresponding value of and the reactance of the capacitor in a neat tabular format as shown in the output below. Reserve 10 spaces for each column.

Enter the frequency, f: 100 Enter the Capacitance, C: 2.3 omega Xc 62.8318 0.0069 314.1590 0.0014 628.3180 0.0007 3141.5901 0.0001 6283.1802 0.0001

(Note: Your answers should be fixed to 4 decimal places, and your output should look exactly like the one shown above.)

3

Question 4

Write a program prompt the user to enter a series of integers number and the last value read is the sentinel 999 (i.e. to end input, the user has to type 999 as the last value) After input terminates, the program should report: 1. The most positive integers value, 2. The most negative integer value, 3. The total number of positive integers entered, 4. The total number of negative integers entered.

Below is how your program output should look like:

Enter an integer Enter an integer Enter an integer Enter an integer Enter an integer Enter an integer Enter an integer Enter an integer Enter an integer End of input Positive The most The most You have You have

(999 (999 (999 (999 (999 (999 (999 (999 (999

to to to to to to to to to

end):3 end):-2 end):4 end):5 end):0 end):-6 end):5 end):66 end):999

integers positive integer is 66. negative integer is -6. entered 6 positive integer(s). entered 2 negative integer(s).

4

Question 5

The inductive reactance of a circuit consisting of an inductor with inductance L in henries at a frequency f in Hz is given by the formula: Where =2f.

Write a program to prompt the user for the frequency, f and inductance, L of an inductor. Then calculate the respective inductive reactance using the formula given above for 0.1f, 0.5f, f, 5f and 10f. Display the corresponding value of and the reactance of the inductor in a neat tabular format as shown in the output below. Reserve 15 spaces for each column Enter the frequency, f: 100 Enter the Inductance, L: 3 omega Xc 62.8318 188.4954 314.1590 942.4770 628.3180 1884.9540 3141.5901 9424.7705 6283.1802 18849.5410

(Note: Your answers should be fixed to 4 decimal places, and your output should look exactly like the one shown above.)

5

Question 6

Write a program that simulates a simple calculator. Your program should prompt the user to enter 2 integers and a character. If the character is a ‘+’, the sum is printed; if it is a ‘-‘, the difference is printed; if it is a ‘*’, the product should be printed; if it is a ‘/’, then quotient is printed; and if it is a ‘%’, the remainder is printed. You may use switch statement. Below is how your program should look like:

Enter 2 integers: 2 3 Enter an operator: + x+y=5 Enter 2 integers: 2 3 Enter an operator: & Wrong operator

6

- SOLENOID
- AC Circuits
- nbsbulletinv12n1p1_a2b
- JAR part 66 examination mod 03
- Optimal Capacitor Placement in a Radial Distribution System Using Plant Growth Simulation Algorithm
- EC303
- Wheatstone Bridge
- Measuring Systems - Problem Set 1 - Solutions
- Aircraft Electronics Technician (AET) Study Guide
- NEMAC93.1_99.pdf
- Multi measurement Unit
- Module 3 B1
- MIL-HDBK-728_2
- EE-1151 CT Submitted Copy
- 2012221141533.pdf
- Design of Microfabricated Inductors
- Yoon 2001
- Net Ties and How to Use Them
- Vessel Volumes
- Curs 4.doc
- ACDB3D87d01
- Magnetization
- Uso de Lonworks
- 9.Enhancement of Power Quality in Distribution
- Plugin BoltExpansion
- Description of a Capacitor
- Model Qa Bhel
- TUT 6 Mohu
- 176616502-Searl-Effect-Generator-Leaked.pdf
- 1-s2.0-S1570870510001617-main

- Analysis of SEPIC for PV-Applications using PI Controller and Current Mode Control
- Fuzzy Logic Control Based MIMO DC-DC Boost Converter for Electric Vehicle Application
- Effective Low Voltage Wireless Charging System with an Active Matching Circuit for AIMD'S
- As 2084-1987 Non-Destructive Testing - Eddy Current Testing of Metal Tubes
- Perpetual Motion Machine of First Kind PMM-1
- tmpF697
- Four switch Three-Level Soft Switched Converter
- Bidirectional Double Buck Boost Dc- Dc Converter
- Standard Coil Products Co., Inc. v. General Electric Company, 306 F.2d 319, 2d Cir. (1962)
- Wireless Mobile Charger
- AUTOMATION IN MANUFACTURING OF WINDING
- An Improved the High Voltage Boost Inversion Ability of Switched Inductor Quasi ZSI by PWM Technique
- tmp244D.tmp
- Fuzzy Control Based Quadrupler Boost Converter
- As NZS 61000.4.8-2002 Electromagnetic Compatibility (EMC) Testing and Measurement Techniques - Power Frequenc
- As 4544-2005 Non-Destructive Testing - Eddy Current Testing for the Detection of Surface Flaws - Ferromagneti
- as11
- WIreless Charger
- Electrical Circuit & Circuit Analysis MCQ'S
- Investigation and Analysis of Magneto Rheological Fluid Damper for Suppressing Tool Vibration during Hard Turning

- tmpBDAA
- tmp4F24
- GMAT Practice Set 5 - Quant
- Echo I Press Kit 60-237
- Pageos Press Kit
- Tmp 1495
- As 2410-2005 Laboratory Glassware - Interchangeable Spherical Ground Glass Joints
- as5
- ch13-3web
- Guidecraft v. Magformers
- 6 CHS and Sphere FAQs (Handout 4 - Optional) Final
- tmp5F0A
- tmp4CF4
- tmpBF5
- Southwest Products Company v. The Heim Universal Corporation, 443 F.2d 621, 2d Cir. (1971)
- Tmp 9506
- Geometrical Solutions Derived from Mechanics; a Treatise of Archimedes by Archimedes, 280? BC-211? BC
- The Whispering Spheres by Winterbotham, Russell Robert
- Optimization
- 1 Module A8 the CHS in the Sphere Handbook Plan
- tmp1F5F.tmp
- as1
- tmpFC6E.tmp
- tmpCF8B
- Sphere Core Standards and CHS Comparison
- tmpA26A

Sign up to vote on this title

UsefulNot usefulRead Free for 30 Days

Cancel anytime.

Close Dialog## Are you sure?

This action might not be possible to undo. Are you sure you want to continue?

Close Dialog## This title now requires a credit

Use one of your book credits to continue reading from where you left off, or restart the preview.

Loading