Preview

Java Environments

Satisfactory Essays
Open Document
Open Document
1345 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Java Environments
CSCI 1101
Computer Science II

Assignment No. 2
Date Given: January 31, 2011
Due: February 18, 2011

David Mongrain
B00554371

Parking ticket simulator

ParkedCar.java
//Object representation of a car. public class ParkedCar
{
private String carMake; private String carColor; private int carLicense;

//Constructs the car, with given car make, car color, and car license.
//Sets the declared instance variables to their respective given values; public ParkedCar(String make, String color, int license) { carMake = make; carColor = color; carLicense = license; }

//This prints the information of the car. public String toString() { String carInfo; carInfo = "Car Make: "+carMake+"\nCar color: "+carColor+"\nLicense Number: "+carLicense+"\n"; return carInfo; }
}

ParkingMeter.java
//Object representation of a parking meter. public class ParkingMeter
{
private int minutesPurchased; private int minutesPassed; private int minutesPassedExp;

//Constructor for Parking Meter with //amount of minutes purchased as only parameter. public ParkingMeter(int minutes, int timePassed) { minutesPurchased = minutes; minutesPassed = timePassed; }

//Get-method for the minutes paid-for. public int getMinutesPurchased() { return minutesPurchased; }

//Get-method for the time passed, in minutes. public int getMinutesPassed() { return minutesPassed; }

//This method gets the minutes passed expiration. public int passedExpiration() { minutesPassedExp = minutesPassed - minutesPurchased; return minutesPassedExp; }

//Prints (if the meter is expired) how long the meter has been expired.
//Otherwise (if the meter is still good), prints the remaining time on the meter. public String toString() { int minutesRemaining; minutesRemaining = minutesPurchased - minutesPassed; String meterDetails; if(minutesPassed > minutesPurchased) meterDetails = "Your meter has

You May Also Find These Documents Helpful

  • Good Essays

    Not able to beat competitors offering more high class atmosphere or competitors adding to their stores…

    • 1534 Words
    • 7 Pages
    Good Essays
  • Powerful Essays

    Chapter 1 Chapter 2 Chapter 3 Chapter 4 Chapter 5 Chapter 6 Chapter 7 Chapter 8 Chapter 9 Chapter 10 Chapter 11 Chapter 12 Chapter 13 Chapter 14 Chapter 15 Chapter 16 Chapter 17 Chapter 18 Chapter 19 Chapter 20 Chapter 21 Chapter 22 Chapter 23 Chapter 24 Chapter 25 Chapter 26 Chapter 27 An Introduction to Hardware, Software, and the Internet An Introduction to Software Development Objects and Classes Algorithms Java Syntax and Style Data Types, Variables, and Arithmetic Boolean Expressions and if-else Statements Iterative Statements: while, for, do–while Implementing Classes and Using Objects Strings Class Hierarchies and Interfaces Arrays…

    • 3908 Words
    • 16 Pages
    Powerful Essays
  • Better Essays

    JPL Foundation Case Study

    • 1478 Words
    • 6 Pages

    Many adult educational programs exist for the underserved populations, the programs offer an extensive variety of educational opportunities as well as personal benefits for the individuals who utilize the programs. Additionally the programs strives to enhance educational opportunities for the adults who may exist with challenges in reference to his or her education level, income level, possesses a disability status, or resides in an unfavorable geographic location. It is not uncommon for foundations to primarily exist from the support of grants and private contributions. The JPL Foundation, Inc. is not an exception to the previous statement. The following paragraphs will serve as documentation in reference to providing a background of The JPL Foundation, Inc. to include the organizations history, structure. Additionally, the following paragraphs will serve as documentation in reference to key characteristics of the program. The key characteristics will include the organizations primary activities and services. The latter paragraphs will serve as documentation in reference to the…

    • 1478 Words
    • 6 Pages
    Better Essays
  • Good Essays

    JROTC In Perspective

    • 554 Words
    • 3 Pages

    JROTC has its advantages and disadvantages. It really depends on the person and their beliefs. JROTC is, in my opinion, what you make of it. In this essay I will discuss the advantages, disadvantages, and my personal opinion about the program.…

    • 554 Words
    • 3 Pages
    Good Essays
  • Good Essays

    Josue Case Study

    • 597 Words
    • 3 Pages

    The B.A.T. clinical team met Josué’s parents and Josué on October 26, 2016. On this date the B.A.T. clinical team conducted an indirect functional assessment, which consisted of a parent interview and review of ABA services in relation to Josué. The B.A.T clinical team gathered information regarding Josué’s history (as outlined in the above section) and inquired about the challenges they encounter, including any behaviors that are of concern. Josué was also present in the home during this visit.…

    • 597 Words
    • 3 Pages
    Good Essays
  • Satisfactory Essays

    CVE-2010-0817 and CVE2010-1886 are the only ones listed that involve privilege elevation and are not considered a high-priority issue.…

    • 293 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Ocean Tours Visual Basic

    • 1010 Words
    • 5 Pages

    Program Name: Ocean Tours Trip Selection ' Author: Fernando Fresnillo ' Date: 03/09/2012 ' Purpose: The Ocean Tours Trip Selection application determines the ' ocean tours available and calculates the cost of the tour. Option Strict On Public Class frmTours ' Class variables Private _intTwoHours As Integer = 2 Private _intThreeHours…

    • 1010 Words
    • 5 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Eclipse and Java for Total Beginners Tutorial Companion Document Eclipse And Java For Total Beginners Companion Tutorial Document By Mark Dexter Table of Contents Introduction........................................................................................................... ............................. 2 . Tutorial Target Audience.....................................................................................................................2…

    • 7556 Words
    • 31 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Environmental Software Research Institute (ESRI) is the developers and distributors of the ArcGIS software suite. The software has a long standing history stretching back to the 1980’s. Today ESRI ArcGIS is a very large software suite that caters for desktop, server, mobile and cloud environments. It is one of the largest (not public) software companies in the world. Providing users with an array of tools and functionality that allows for the analysis, distribution and capturing of spatial information from various sources and using various methods.…

    • 743 Words
    • 3 Pages
    Satisfactory Essays
  • Better Essays

    The prototype was developed under the Microsoft technologies stack. However, since I only have Apple computers at home I had to make use of the free VirtualBox solution. Gratefully, as a UH student, I was able to download Windows 7 Professional with Service Pack 1 64-bit and Visual Studio Community 2015 with Update 2 64-bit for free from the Dreamspark site.…

    • 1442 Words
    • 6 Pages
    Better Essays
  • Good Essays

    Case Study on Jolibee

    • 2583 Words
    • 11 Pages

    • In order for the business to operate and coordinate more efficiently in the domestic network, Jollibee decentralize the organization into 4 regional business units (RBUs) according to major geographical markets. This structure allows timely decision making and ensured a more manageable business size and span of control.…

    • 2583 Words
    • 11 Pages
    Good Essays
  • Good Essays

    environment control system

    • 2070 Words
    • 9 Pages

    The Environmental Control System of an airliner provides air supply, thermal control and cabin pressurization for the passengers and crew. Avionics cooling, smoke detection, and fire suppression are also commonly considered part of the Environmental Control System.…

    • 2070 Words
    • 9 Pages
    Good Essays
  • Powerful Essays

    import java.io. *; import java.awt. *; import java.awt.event. *; import javax.swing. *; import java.sql.…

    • 3009 Words
    • 13 Pages
    Powerful Essays
  • Powerful Essays

    Figure 5 Energy sources in Africa by source in the year 2009 (world fact book, 2010)…

    • 5917 Words
    • 24 Pages
    Powerful Essays
  • Powerful Essays

    Physical Environment

    • 6260 Words
    • 26 Pages

    A map is a graphic representation of a portion of the earth 's surface drawn to scale, as seen…

    • 6260 Words
    • 26 Pages
    Powerful Essays

Related Topics