{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

InLab05 - In-Lab Assignment#5 Arrays(Ch 6 Instructions...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
In-Lab Assignment #5: Arrays (Ch 6) Instructions: Select any problems for a maximum of 10 points (no extra credit). Collaboration is permitted. Students present during lab have until midnight tomorrow to submit their files. Submit your .java files as instructed by your TA. 1. (4 pts) Write a program to display the Fall semester holiday schedule. Create three arrays to contain the data in the table below and display the data using a loop as shown on the right. Your loop should use .length to determine how many lines to print. Month Day Holiday Output 9 3 Labor Day 9/3: Labor Day 10/22: Fall Break 10/23: Fall Break 11/22: Thanksgiving 11/23: Thanksgiving 10 22 Fall Break 10 23 Fall Break 11 22 Thanksgiving 11 23 Thanksgiving 2. (6 pts) Write a program that lets the user guess a power of 3. Your algorithm should work as follows: a. The first ten powers of 3 are 3 0 to 3 9 . Store them in an array using a loop, .length , and Math.pow(). The index number of each element should be the exponent of the value. For example, 3 9 should have an array index of 9.
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}