21 Aug CSE 1223 Project 12 (Simple Clock)
Overview
You will be writing portions of a Java class that models a very simple clock. You will also be provided with two different “front ends” that use this same class as a plug-in – a simple program that loops through the time for a full hour of time, displaying each passing second on your screen, and a slightly more complex program that displays the time in a window and allows you to update it with a click of a button. If you have coded your clock class correctly, these two programs provided will just work when you run them.
Objectives
- Practice with programming fundamentals
- Variables – Declaration and Assignment
- Primitive types
- Branching: if-else if-else syntax, nested if-else syntax
- Nested while loops
- Methods – simple functions and procedures
- Object-oriented programming
- Works towards the following Course Goals:
- Competency with using basic coding features of a high-level imperative programming language
- Competency with writing computer programs to implement given simple algorithms
- Familiarity with designing simple text-oriented user interfaces
Project 12 Description
This lab is structured differently than previous labs. For this lab you are provided with three Java files – Project12.java and ClockView.java hold code that you do not need to touch. You will only be writing code in the file SimpleClock.java. Create a new project named “Project 12” and import all three of these source code files into your project workspace. All three of these files must be in the same Project folder, and must all be in the same default namespace in your Eclipse workspace.
Open the SimpleClock.java file. In this file is a partial implementation of the SimpleClock class. You must fill in the code for the constructor, as well as for the methods set, tick and time, following the instructions provided for each of these methods in the comments for these methods.
When you think that you have them working, run the Project12.java program. You should see output like the following:
Clock starts at time: 12:00:00 AM
Clock has been set to time: 11:59:00 PM
TICK: 11:59:01 PM
TICK: 11:59:02 PM
TICK: 11:59:03 PM
TICK: 11:59:04 PM
TICK: 11:59:05 PM
TICK: 11:59:06 PM
TICK: 11:59:07 PM
… Many lines of output like the above …
TICK: 12:58:58 AM
TICK: 12:58:59 AM
TICK: 12:59:00 AM
Clock finally reads: 12:59:00 AM
Once you have that working, try running ClockView.java. It should pop up a window with a midnight time showing and two buttons – Tick and Reset. The Tick button should increment the clock by one second, the reset button should set it back to midnight. Play with this interface to make sure it works as expected.
Our website has a team of professional writers who can help you write any of your homework. They will write your papers from scratch. We also have a team of editors just to make sure all papers are of HIGH QUALITY & PLAGIARISM FREE. To make an Order you only need to click Ask A Question and we will direct you to our Order Page at WriteDemy. Then fill Our Order Form with all your assignment instructions. Select your deadline and pay for your paper. You will get it few hours before your set deadline.
Fill in all the assignment paper details that are required in the order form with the standard information being the page count, deadline, academic level and type of paper. It is advisable to have this information at hand so that you can quickly fill in the necessary information needed in the form for the essay writer to be immediately assigned to your writing project. Make payment for the custom essay order to enable us to assign a suitable writer to your order. Payments are made through Paypal on a secured billing page. Finally, sit back and relax.
About Wridemy
We are a professional paper writing website. If you have searched a question and bumped into our website just know you are in the right place to get help in your coursework. We offer HIGH QUALITY & PLAGIARISM FREE Papers.
How It Works
To make an Order you only need to click on “Order Now” and we will direct you to our Order Page. Fill Our Order Form with all your assignment instructions. Select your deadline and pay for your paper. You will get it few hours before your set deadline.
Are there Discounts?
All new clients are eligible for 20% off in their first Order. Our payment method is safe and secure.
