Purchase Solution

Using Java to Determine Weekly Rate

Not what you're looking for?

Ask Custom Question

The program should allow users to enter the age of the child and the number of days per week stays. Need to write the input statements and the code that initializes the two-dimensional array, determines the weekly rate and prints the weekly rate.

1. Open the source code DayCare.java
2. Declare and intialize the two-dimensional array
3. Write the Java Statements that retrieve the age of the child and the number of days the child will be at the day care center.
4. Determine and print the weekly rate.

Please see attachments for the questions.

import javax.swing.*;

public class DayCare
{
public static void main(String args[])
{
// Declare two-dimensional array here.

// Declare other variables.
int numDays;
int age;
String numDaysString;
String ageString;
int QUIT = 99;

// This is the work done in the getReady() method
// Perform a priming read to get the age of the child.

while(age != QUIT)
{
// This is the work done in the determineRateCharge() method
// Ask the user to enter the number of days

// Print the weekly rate

// Ask the user to enter the next child's age

}
// This is the work done in the finish() method
System.out.println("End of program");

System.exit(0);
} // End of main() method.
} // End of DayCare class.

Purchase this Solution

Solution Summary

The following posting helps use java to determine weekly rate.

Solution Preview

Hi There,

Here is the solution that is also in an attachment.

import javax.swing.*;

public class DayCare {
public static void main(String args[]) {
// Declare two-dimensional array here.
double[][] rates = {
{30.00, 60.00, 88.00, 115.00, 140.00},
{26.00, 52.00, 70.00, 96.00, 120.00},
{24.00, 46.00, 67.00, 89.00, 110.00},
{22.00, 40.00, 60.00, 75.00, ...

Purchase this Solution


Free BrainMass Quizzes
Word 2010: Table of Contents

Ever wondered where a Table of Contents in a Word document comes from? Maybe you need a refresher on the topic? This quiz will remind you of the keywords and options used when working with a T.O.C. in Word 2010.

Basic Computer Terms

We use many basic terms like bit, pixel in our usual conversations about computers. Are we aware of what these mean? This little quiz is an attempt towards discovering that.

Basic UNIX commands

Use this quiz to check your knowledge of a few common UNIX commands. The quiz covers some of the most essential UNIX commands and their basic usage. If you can pass this quiz then you are clearly on your way to becoming an effective UNIX command line user.

Basic Networking Questions

This quiz consists of some basic networking questions.

Java loops

This quiz checks your knowledge of for and while loops in Java. For and while loops are essential building blocks for all Java programs. Having a solid understanding of these constructs is critical for success in programming Java.