Utilizamos seu perfil e dados de atividades no LinkedIn para personalizar e exibir anúncios mais relevantes. Altere suas preferências de anúncios quando desejar.
Próximos SlideShares
Carregando em…5
×

# MELJUN CORTES Jedi course notes intro1-appendix f-additional exercises

2.489 visualizações

MELJUN CORTES Jedi course notes intro1-appendix f-additional exercises

• Full Name
Comment goes here.

Are you sure you want to Yes No
• Seja o primeiro a comentar

### MELJUN CORTES Jedi course notes intro1-appendix f-additional exercises

1. 1. J.E.D.I. Appendix F : Additional ExercisesChapter 1: Introduction to ComputerProgramming No EntriesChapter 2: Introduction to Java No EntriesChapter 3: Getting to Know your ProgrammingEnvironment No EntriesIntroduction to Programming I 1
2. 2. J.E.D.I.Chapter 4: Programming Fundamentals1. Create a program that will compute the electric bill of a person given the followingranges:Range Cost1 – 99 kilowatts P10.oo/kilowatt100-249 kilowatt P50.00/kilowatt after the first 99 kilowatt hours250 or more P 100 pero kilowatt every kilowatt hour succeedingThe program must trap erroneous values before allowing the user to continue. Erroneousvalues are negative numbers and zero.Sample outputs: Enter number of kilowatt hours: 10 Total Electric bill is P 100.00 Enter number of kilowatt hours: 100 Total Electric bill is P5000.00 Enter number of kilowatt hours: 251 Total Electric bill is 8690.00 Enter number of kilowatt hours: 0 Enter number of kilowatt hours: -4 Enter number of kilowatt hours: 10 Total Electric bill: P100.002. Write a program that reads in three whole numbers and outputs the average of thethree numbers.3. Write a program that converts degrees Celsius to Fahrenheit using the formuladegreesC = 5(degreesF) – 32/9. Prompt the user to enter a temperature in degreesFahrenheit (just a whole number of degrees, without a fractional part) and print out theequivalent Celsius temperature including the fractional part to at least one decimal point.A possible dialog might be: Enter a temperature in degrees Fahrenheit: 72 72 degrees Fahrenheit = 22.2 degrees Celcius"4. Bunyan Lumber Co. needs to create a table of the engineering properties of itslumber. The dimensions of the wood are given as the base and the height in inches.Engineers need to know the following information about lumber: cross-sectional area: base * height moment inertia: (base * height3) /12 section modulus: (base * height2)/6The owner makes lumber with base sizes of 2, 4, 6, 8, and 10 inches. The height sizesare 2, 4, 6, 8, 10, and 12 inches. Produce a table with appropriate headings to showthese values and the computed engineering properties. The first part of the table’soutline is shown.Lumber size Cross-sectional area Moment of inertia Section Modulus2x22x42x62x82 x 102 x 124x24 x 4 .......Introduction to Programming I 2
3. 3. J.E.D.I.5. Write a program for an Automatic Teller Machine that dispense money. The usershould enter the amount desired (a multiple of 10 dollars) and the machine dispensesthis amount using the least number of bills. The bills dispensed are 50s, 20s and 10s.Write a function that determines how many each kind of bill to dispense.6. Create a program that stores 100 integers in an array, get the sum of all the numbersin the array using loops and outputs the result.The output should display the following:0 1 2 3 4 5 67 ..................... 99The sum of numbers 1-100 is 4950.Introduction to Programming I 3