Difference between revisions of "Program a day"

From CompSciWiki
Jump to: navigation, search
Line 46: Line 46:
  
 
=[[Program A Day: Introducing Arrays|Week 9: Introducing Arrays]]=
 
=[[Program A Day: Introducing Arrays|Week 9: Introducing Arrays]]=
{{1010PrAD|ProblemName=Creating An Array
 
  
|Problem= There 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.
 
 
 
|SideSection=
 
[[Image:OperatingSystemExample.jpg|float|267px]]
 
<BR>
 
Taken from http://www.flickr.com/photos/daniello/565304023/
 
 
An image or By Students section
 
 
|Solution=
 
public 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};
 
  }
 
}
 
 
}}
 
  
 
===[[Printing an Array]]===
 
===[[Printing an Array]]===

Revision as of 12:12, 1 April 2010


Wiki 1010 Table of Contents

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

Printing an Array

Fibonacci Numbers

Array Data Types

Multi-dimensional Arrays

Equating Two Arrays

Week 10: Arrays and Methods

printArray Method

Week 11: Arrays of Strings

Something with parallel arrays

Creating a grocery list

Make a String from an array of words

Week 12: Array Algorithms

Find Element x Using Linear Search

Find Max Using Linear Search

Week 13: Problem Solving and Programming Examples

Break This Password

ASCII Art Examples

Rock Paper Scissors

Finding Min/Max in an array