Code Monkey home page Code Monkey logo

acsl-acslland's Introduction

ACSL-ACSLland

This program was written for Contest #1 of the Senior Division of the American Computer Science League 2014-2015 competition. It was written in Java. As per competition rules, I had three days to complete this program.

Please note, though not a stipulation of the competition, I was challenged to write this program without converting time values into military time. I understand that the conversion into military time would simplify my current algorithm.

#Program Description The purpose of this program is to aid two hypothetical travelers in ACSLland. Each traveler starts at a specific city at a specific time and moves towards the other. Ultimately, this program outputs how long it will take the first traveler to meet up with the second. This output is printed in either the hh:mm or h:mm format (h stands for hours and m stands for minutes) rounded to the nearest minute.

It is safe to assume that the shortest time should be computed. For example, the difference between 3 PM and 5 PM is always 2 hours, never 22 hours.

The different starting cities are represented by letters. The distance between cities is below.

A-B : 450

B-C : 140

C-D : 125

D-E : 365

E-F : 250

F-G : 160

G-H : 380

H-J : 235

J-K : 320

#Input Each input has 8 lines. The first two lines contain letters representing the starting cities of two travelers. The next two lines contain the starting time of the first traveler and either AM or PM. The next two lines contain the starting time of the second traveler and either AM or PM. The last two lines contain the average speed of the first traveler, followed by the average speed of the second traveler.

For the contest, there are 5 inputs.

#Sample Sample Input (each comma represents a hard enter):

A, C, 1, PM, 2, PM, 50, 60

Sample Output:

8:41

acsl-acslland's People

Contributors

kerdma6777 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.