Program a day
From CompSciWiki
Chapter #Practice your programming and problem-solving skills. Write a program for each (week) day you are in COMP 1010. | ||
---|---|---|
Write a Program a Day | Case Studies |
Table of Contents |
---|
Week 1: Getting Started
Hello World
Mad Lib
Week 2: Primitive Data Types
Grading Problem
Calculate Area
Week 3: If/Nested If Statements and Named Constants
Dimensions of a Can of Soup
Letter Grade Conversion
Week 4: While Loops - Do While Loops - For loops
Print Out the Alphabet
Guess my Number
Input Validation
Convert this While to a For
Print Prime Numbers
Week 5
Vowel Counter
Leap Year Problem
Secret Code
Week 6: Problem Solving with Nested Loops
Rainfall Averager
Adding Two Matrices
Computing Prime Numbers
Print a Calendar
Week 7: Midterm Review
Week 8: Static Methods
Print Array
Return Array
Fix Code Sample
Week 9: Introducing Arrays
Back to the Program-A-Day homepage
ProblemThere are ten students with ten grades. Instead of storing every single grade in a single variable it is easier to store this information in an array. Given that the grades are 56%, 34%, 75%, 89%, 78%, 87%, 71%, 67%, 98%, 85%, store the grades in an integer array as percents and convert them to decimals and store them in a double array. |
SideSectionTitle
An image or By Students section | |
---|---|---|
Solutionpublic class Creating{ public static void main(String[] args){ int[] intArray = {56, 34, 75, 89, 78, 87, 71, 67, 98, 85}; double[] decimalArray = {0.56, 0.34, 0.75, 0.89, 0.78, 0.87, 0.71, 0.67, 0.98, 0.85}; } } | ||
CodeSolutionCode goes here. Please DO NOT put your code in <pre> tags! |