News Ticker

Menu

Browsing "Older Posts"

Browsing Category "Java"

Simple Trip Planner with file handling in Java complete source

Saturday, 7 May 2016 /

Simple Trip Planner

This assignment is inspired by the problem of planning a European holiday by train, making optimal use of travel time. Your aim is to take each of a number of given train trips, e.g. London to Paris. Your journey must include a number of given trips, but may include additional trips to "link up" the cities in the trips you want to take. For simplicity, we assume that trains run frequently, so that you can focus on scheduling a journey that includes all of your specified trips and minimizes time takes to complete the journey (so you don't have to consider time lost waiting around for departures). The trips in your journey can be scheduled in any order, but your journey always starts in London. The aim is to minimize the total journey time, taking into account travel time and a transfer time in each city (except in London at the start of the journey).

We assume that all cities can be reached by train directly from any other city, and that the travel time between any two cities is the same in either direction (so need only be specified in one direction). This means that the travel times between each pair of cities will be given. Furthermore, we assume the following "triangle inequality" on travel times: for any cities A, B and C, the travel time from A to C is always less than or equal to the travel time from A to B plus the travel time from B to C.

In this assignment, you will implement an A* search procedure for the trip planning problem. In your program design, make use of the Strategy pattern to supply a heuristic to the search procedure, and don't forget to ensure that your heuristic is admissible. Implementing A* is the main requirement for this assignment, so that your program is guaranteed to produce an optimal solution. If your program does not always produce an optimal solution, then it is wrong. Assessment will be based on the design of your program in addition to correctness. You should submit at least a UML class diagram used for the design of your program, i.e. not generated from code afterwards. All input will be a sequence of lines of the following form, and all cities and travel times will be declared before any trip requirements:

Transfer <time> <name>
# Transfer time is <time> minutes in city <name>
Time <time> <name1> <name2>
# Travel time is <time> minutes from city <name1> to city <name2>
Trip <name1> <name2>
# Journey requires a trip from <name1> to <name2>

Create all your Java source files in the default package. Call your main Java file TripPlanner.java. Read input from a file whose name is passed as an argument to the main method in the call to java TripPlanner and print output to System.out. For machine marking, the output will be redirected to a text file that will be compared to the expected output (so do not print out extra spaces, etc.) and remember to close the file. For the purposes of machine marking, problems will be used for which there is only one optimal solution, though in the case of multiple optimal solutions, your program should produce one of them.

To read input from a text file (whose name should be passed as a command line argument to java, e.g. java TripPlanner input.txt), use code such as:

Scanner sc = null;
        try {
            sc = new Scanner(new FileReader(args[0]));
           
            # args[0] is the first command line argument } catch (FileNotFoundException e) {
        } finally {
            if (sc != null) {
                sc.close();
            }
        }

Sample Input: 

For example, the following input has five cities and four required trips as indicated. This means that 10 travel times between cities need to be specified (which can be given in any order). The format and meaning of the input is as follows (comments are for explanation and should not appear in the actual input):


Sample Output:

The above example does not have a unique optimal solution. One valid output corresponding to the above input is as follows. The first line in the output should give the number of nodes n expanded in your search, the number of nodes taken off the queue, which will vary according to the heuristic used. The second line of the output should give the cost of the solution found as an integer, which is the total time taken, and should be the same regardless of the heuristic and the solution path. The remainder of the output should give a sequence of trips that make up an optimal solution. If your program produces a different optimal solution from the one shown (with the same cost) then it is correct.

 order now

Simple Trip Planner with file handling in Java complete source - Buy Now

/
Buy now

Simple Trip Planner

This assignment is inspired by the problem of planning a European holiday by train, making optimal use of travel time. Your aim is to take each of a number of given train trips, e.g. London to Paris. Your journey must include a number of given trips, but may include additional trips to "link up" the cities in the trips you want to take. For simplicity, we assume that trains run frequently, so that you can focus on scheduling a journey that includes all of your specified trips and minimizes time takes to complete the journey (so you don't have to consider time lost waiting around for departures). The trips in your journey can be scheduled in any order, but your journey always starts in London. The aim is to minimize the total journey time, taking into account travel time and a transfer time in each city (except in London at the start of the journey).

We assume that all cities can be reached by train directly from any other city, and that the travel time between any two cities is the same in either direction (so need only be specified in one direction). This means that the travel times between each pair of cities will be given. Furthermore, we assume the following "triangle inequality" on travel times: for any cities A, B and C, the travel time from A to C is always less than or equal to the travel time from A to B plus the travel time from B to C.

In this assignment, you will implement an A* search procedure for the trip planning problem. In your program design, make use of the Strategy pattern to supply a heuristic to the search procedure, and don't forget to ensure that your heuristic is admissible. Implementing A* is the main requirement for this assignment, so that your program is guaranteed to produce an optimal solution. If your program does not always produce an optimal solution, then it is wrong. Assessment will be based on the design of your program in addition to correctness. You should submit at least a UML class diagram used for the design of your program, i.e. not generated from code afterwards. All input will be a sequence of lines of the following form, and all cities and travel times will be declared before any trip requirements:

Transfer <time> <name>
# Transfer time is <time> minutes in city <name>
Time <time> <name1> <name2>
# Travel time is <time> minutes from city <name1> to city <name2>
Trip <name1> <name2>
# Journey requires a trip from <name1> to <name2>

Create all your Java source files in the default package. Call your main Java file TripPlanner.java. Read input from a file whose name is passed as an argument to the main method in the call to java TripPlanner and print output to System.out. For machine marking, the output will be redirected to a text file that will be compared to the expected output (so do not print out extra spaces, etc.) and remember to close the file. For the purposes of machine marking, problems will be used for which there is only one optimal solution, though in the case of multiple optimal solutions, your program should produce one of them.

To read input from a text file (whose name should be passed as a command line argument to java, e.g. java TripPlanner input.txt), use code such as:

Scanner sc = null;
        try {
            sc = new Scanner(new FileReader(args[0]));
       
            # args[0] is the first command line argument } catch (FileNotFoundException e) {
        } finally {
            if (sc != null) {
                sc.close();
            }
        }

Sample Input: 

For example, the following input has five cities and four required trips as indicated. This means that 10 travel times between cities need to be specified (which can be given in any order). The format and meaning of the input is as follows (comments are for explanation and should not appear in the actual input):


Sample Output:

The above example does not have a unique optimal solution. One valid output corresponding to the above input is as follows. The first line in the output should give the number of nodes n expanded in your search, the number of nodes taken off the queue, which will vary according to the heuristic used. The second line of the output should give the cost of the solution found as an integer, which is the total time taken, and should be the same regardless of the heuristic and the solution path. The remainder of the output should give a sequence of trips that make up an optimal solution. If your program produces a different optimal solution from the one shown (with the same cost) then it is correct.



Buy now

User Interface related questions command line, GUI and metaphor

Tuesday, 3 May 2016 /
Buy now

Question 1 GUI Related:

When input information can effectively be provided by selecting from a list or pointing at an object or position, direct manipulation interfaces are usually considered "easier to use" than interfaces based on textual commands. But direct manipulation interfaces are not always best. What kinds of situations are better served by type-in command-based interfaces? Use examples to illustrate your answer.


Question 2 GUI Related:


Discuss the role of metaphor in relation to the design of user interface components. In particular, identify the advantages and disadvantages of using metaphors when designing interface widgets, giving examples to illustrate your answer.

Order your work now!


Buy now

Extra Credit Assignment 3: Loan Calculator Java Implementation Source Code

Saturday, 16 April 2016 /
Buy now

Problem Description

The monthly payments for a given loan are divided into amounts that apply to the principal and to the interest. For example, if you make a monthly payment of $500, only a portion of the $500 goes to the principal and the remainder is the interest payment. The monthly interest is computed by multiplying the monthly interest rate by the unpaid balance. The monthly payment minus the monthly interest is the amount applied to the principal. The following table is the sample loan payment schedule for a one-year loan of $5,000 with a 12 percent annual interest rate. The monthly payment would be $444.24.

Write an application that accepts a loan amount, annual interest rate, and loan period (in number of years) and displays a table with five columns: payment number, the interest and principal paid for that month, the remaining balance after the payment, and the total interest paid to date. Note: The last payment is generally different from the monthly payment, and your application should print out the correct amount for the last payment. Use a formatter to align the output values neatly. If the input values are invalid, then print out an appropriate error message. Decide on the range of valid values for the loan amount, interest rate, and loan period.

Objective

The objectives of this extra credit assignment:
Understand the concept of object-oriented programming.
Understand the concepts of repetition statements.
Understand the use of standard Java classes.
Familiarize with code documentation, compilation, and execution.
Expose to Java syntax, programming styles, and Java classes.

Code Screenshots



Order Now:

Buy now

Extra Credit Assignment 2: Slot Machine in Java with full source code

/
Buy now

Problem Introduction:

Write an application that simulates a slot machine. The player starts out with M coins. The value of M is an input to the program, and you charge 25 cents per coin. For each play, the player can bet 1 to 4 coins. If the player enters 0 as the number of coins to bet, then the program stops playing. At the end of the game, the program displays the number of coins left and how much the player won or lost in the dollar amount. There are three slots on the machine, and each slot will display one of the three possible pieces: BELL, GRAPE, and CHERRY. When certain combinations appear on the slots, the machine will pay the player. The payoff combinations are these:
The symbol --------- means any piece. If the player bets 4 coins and gets combination 5, for example, the machine pays the player 12 coins.

Code Screenshot:


Order Now:

Buy now

Extra Credit Assignment 1: Rock – Paper – Scissors Java Implementation

/
Buy now

Problem:

Design and implement an application that plays the Rock-Paper-Scissors game against the computer. When played between two people, each person picks one of three options (usually shown by a hand gesture) at the same time, and a winner is determined. In the game, Rock beats Scissors, Scissors beats Paper, and Paper beats Rock. The program should randomly choose one of the three options (without revealing it) then prompt for the user’s selection. At that point, the program reveals both choices and indicates if the user won, the computer won, or if there was a tie. Continue playing until the user chooses to stop, and then show the number of user wins, losses, and ties.

Objective:


  1. Understand the concept of object-oriented programming.
  2. Understand the use of standard Java classes.
  3. Familiarize with code documentation, compilation, and execution.
  4. Expose to Java syntax, programming styles, and Java classes.

Code Screenshots:





Order Now:

Buy now

HTML, PHP URL registration and lising program Internet Programming Spring 2016 Assignment #5

/
Buy now

Introduction

Create and run a SQL script with a database named URL and a table named Urltable. The first field of the table should contain an actual URL, and the second, which is named Description, should contain a description of the URL.

Write a PHP script that obtains a URL and its description from a user and stores the information into a database using MySQL. After each new URL is submitted, print the contents of the database in a table.

Requirements:

Store the structure of the tables in a txt file for submission.

Output Screenshots:


Order now!

Buy now

Car Racing Java API Level 2.2 complete implementation with source code

/
Buy now

Major Coursework #2

In this coursework, you are required to implement an Android Game App, create an installable apk that can be installed on an Android phone (API level 2.2) and write a report that describes the design and justifies improvements.

The GameYou are required to develop Java code to implement an Android app inspired by the traditional top-down racing game. The code MUST extend the code base provided for the practical in week 7 of Spring term.

The OOP Design

You are required to develop an OOP design before starting implementation. This should be discussed and signed off in your practical session in week 8 of spring term. This will be marked in that week’s practical sign off sheet. You must include an electronic version (e.g. scan handwritten work) in an appendix of the submitted report.
You can later change the design. You must, however, justify your changes in the final report

Your game should:


  • Have functionality to start individual games on a screen using a separate welcome or start screen. The welcome screen must function using the Android library buttons.
  • Display the current score while playing. You define scoring mechanisms.
  • Have a Car that the user controls. 
    • Controlled by touches on the screen and/or sensors within the phone.
  • Have a Track
    • The player will lose a “life” or energy if the car drives off the track. (Try different retro racing games for inspiration.)
    • The track cannot be straight. I.e. it must have corners or change shape while the player drives through the track
  • Have Opponent cars or other vehicles
    • Must have more than one opponent on screen at some point in the gameplay. 
    • This can be opponents that the player is racing against (functioning as A.I. players), or slow driving cars that need to be overtaken, e.g. for extra points.
  • At least three game levels with different tracks and/or types of opponents with different behaviours.
  • Higher marks available for creation of new levels (e.g. levels stored online, in files or easy to reuse data structures within the game)
    • Marks are given for the complexity of the solution. 
      • Using online levels receives higher marks than storing them in a local file.
      • Using appropriate OOP design receives higher marks than one that does not.
  • Research and improve memory and speed efficiency of the game. This process, including tests to verify claims, must be described and justified in the report
  • There are 20% (capped) marks available for
  • Creating an online high score list. This must be hand coded, i.e. without using high score list libraries such as Google Play Services. You can, however, base the server-side code on the code provided in week 3 and 4 of spring term (worth max. 15%). Researching and improving multithreading of the game. This should be described and justified in the report (worth max. 15%)

Output Screenshot:


Order now and get you work in a minute :)


Buy now

Connect-K in Java Data Structures Compelete Source code

/
Buy now

Introduction:

In the game of Connect-K, red and blue pieces are dropped into an N-by-N table. The
the table stands up vertically so that pieces drop down to the bottom-most empty slots in their column. For example, consider the following two configurations:-

Legal Position -

.......
..................R
.....RB....
BRB...
RBBR.. -

Illegal Position -

............................Bad
 - ..BR......
R....
RBBR..

In these pictures, each '.' represents an empty slot, each 'R' represents a slot filled with a red piece, and each 'B' represents a slot filled with a blue piece. The left configuration is legal, but the right one is not. This is because one of the pieces in the third column (marked with the arrow) has not fallen down to the empty slot below it.
A player wins if they can place at least K pieces of their colour in a row, either horizontally,
vertically, or diagonally. The four possible orientations are shown below:

- Four in a row -

R RRRR R RR R RR R RR R R
In the "Legal Position" diagram at the beginning of the problem statement, both players had lined up two pieces in a row, but not three.
You have a tricky plan to ensure victory with Connect-K! When your opponent is not looking, you are going to rotate the board 90 degrees clockwise onto its side. Gravity will then cause the pieces to fall down into a new position as shown below:

- Start -

........................R......RB....BRB...RBBR.. - Rotate -
.......R......BB..... BRRR...RBB.................. - Gravity -
.....................R......BB.....BRR....RBBR... Unfortunately, you only have time to rotate once before your opponent will notice.All that remains is picking the right time to make your move. Given a board position, you should determine which player (or players!) will have K pieces in a row after you rotate the board clockwise and gravity takes effect in the new direction.
NotesYou can rotate the board only once.Assume that gravity only takes effect after the board has been rotated completely. Only check for winners after gravity has finished taking effect.

Input

The first line of the input gives the number of test cases, T. T test cases follow, each beginning with a line containing the integers N and K. The next N lines will each be exactly N characters long, showing the initial position of the board, using the same format as the diagrams above.
The initial position in each test case will be a legal position that can occur during a game of Connect-K. In particular, neither player will have already formed K pieces in a row.

Output

For each test case, output one line containing "Case #x: y", where x is the case number (starting from 1), and y is one of "Red", "Blue", "Neither", or "Both". Here, y indicates which player or players will have K pieces in a row after you rotate the board.

Limits

1 ≤ T ≤ 100.3 ≤ K ≤ N. Small dataset 3 ≤ N ≤ 7.Large dataset
3 ≤ N ≤ 50.

Example

You can search the Internet for another algorithm that has not been taught in class, and present, subject to the approval of the lecturer. Whatever the algorithm chose, the group will have to find (or implement) a Java implementation and show it, run it and discuss the code of such algorithm in a PowerPoint presentation in front of the class at the end of the course. Submission

Code Screenshots:



Order Now:

Buy now

Lock Up Tite user authentication program in Java GUI

Thursday, 14 April 2016 /
Buy now

Objective 

You work for a company called Lock Up Tite. They want you to write a front end program to grant authentication access to programs using a user name and password. Requirements Write a program that creates a loop and has three options for the user to select.

Option 1 allows the user to add a user name and password, which is then stored into a file.

Option 2 allows the user to enter a user name and password up to three times. For a given attempt, the user will be notified if the attempt is successful or unsuccessful.

Option 3 will exit the loop and end the program Main Menu Requirements: When the program starts, present the user with a menu offering the three options described above. After the user chooses either option 1 or 2, the program should go back to the main menu. The final option will end the program.

Option 1 Requirements:

This option prompts the user for their user name and password and stores them in a file named passwords.txt. The program should not overwrite what's already in the file; it should append the new user name and password to the end of the file.

Option 2 Requirements: 

This option uses the passwords.txt file to verify the user is entering a valid user name and password. It begins by asking the user for a user name and password within a loop that runs up to three times. If the password is correct, an appropriate message will be printed, the loop will end, and the program will go back to the main menu. If the user is unable to provide a user name and password that matches any of the combinations in the file, an appropriate message will be printed and the user will be allowed to try again. If the user fails after three attempts, the loop should end and the program should go back to the main menu.

Technical Requirements: 


1. Create a Java program named LockUpTite.java.

2. Create a procedure for each major task in the program. Call the procedures based on the option selected by the user.

3. After completing the tasks of Option 1 or 2, re-display the menu and allow the user to pick another option. Option 3 will exit the program.

4. Make sure your program is adequately commented, uses consistent naming conventions for variable and module names, and uses appropriate indentation and line spacing to enhance the readability of the code.

Instructions Follow these instructions as you build your program: 


1. Create the LockUpTite.java class and create a main() method.

2. In the main() method, create a try-catch block. Within the try block, get the path to theplayers.txt file. While you can do this many different ways, the easiest approach is to put all your files in the same folder and use Path filePath = Paths.get("players.txt"); If you use an IDE that keeps .java and .class files in a separate folder, then use the following approach: Path filePath = Paths.get("players.txt").toAbsolutePath();

3. You may want to declare this variable outside of the main() method but within the class so that the other functions you build can use it.

4. For the function that responds to Option 2, you should do the following:
(a) Ask the user for a username and password.
(b) Create a Boolean variable to indicate a successful login, and set it to false.
(c) Open the players.txt file by creating a BufferedReader object. Call theFiles.newBufferedReader() method and pass it the BufferedReader reader = Files.newBufferedReader(filePath); NOTE: If you are using Java 7, this technique will not work. Instead, you must send two arguments, aPath and a Charset. So if you are using
Java 7, you will need to do the following:

import java.nio.charset.Charset; Create your Path object as outlined above. Then when you create the BufferedReader: BufferedReader reader = Files.newBufferedReader(filePath, Charset.forName("UTF-8"));

1. Create a String named line, and assign it to reader.readLine(), where reader is the name of theBufferedReader object you created in step 4.

2. Create a while loop that will continue as long as line is not NULL and a match has not been found.
(a) Within the loop, use the line object’s split() method to break the String into two pieces, both of which should be stored in a String array.
(b) Check the name and password for a match. The user name taken from the file will be stored in the first element of the array; the password will be in the second. If both match, set Boolean to true.
(c) Assign line to the next line of text in the file by calling reader.readLine().

3. Below the while loop, check the Boolean variable. If it is true, then a match was found. If not, bump a counter to give the user a second chance unless the value of the counter has exceeded three increments.

4. Within the catch block, print out the Exception object’s error message.

Output Screenshots:








Order Now and get your work!


Buy now

Moving shapes in JavaFX with Multi threading

Wednesday, 6 April 2016 /

Multithreading and JavaFX

Create an object-oriented JavaFX GUI that shows two shapes or images moving around a GUI. Each shape will have its thread to move it around the GUI. You must use threads – not AnimationTimelines or JavaFx Paths- this is a threading homework that happens to use JavaFx- not just a JavaFx homework.

You must have two separately distinct activities. Two flashing texts are only one different activity. I have provided an example of how to move an image in a circle and flashing text using threads. You may choose one of these, but your second activity must be different from shooting and moving in a circle. Do not directly copy the examples- you may use the algorithm with other things. Try moving in an up-down, side to side, zig-zag, etc. Be sure to shut down all threads when the Application closes. (Hint: interrupt() method on Thread class)

Your program should consist of multiple classes. Put thread Runnable classes in a different class from Application and pass shared information in the constructor.

Order Now:


Buy now

CRC code with command line arguments in Java, Checking correctness and verfication

Sunday, 3 April 2016 /
Buy now

Program  Submission  Instructions:      

•   You must submit your source code file plus a README file
•   The source code file must be provided in Web courses from the assignment page
•   All source code must be in exactly one file of type .c, .cpp, or .java
•   The README file must be a text file

CIS    3360    –    Security    in   Computing    Spring    2016
Program  #2:    CRC    Codes  (100  points)  

Write a    program that    calculates the    CRC-­‐15    value for a    given file    and which    can also    verify the    correctness of    a    given file that    already has    a    CRC-­‐15    value appended    to it,    as more    fully described    below.

Use  the    CRC    polynomial:    x15+x13+    x6+x4+x1+1.

JavaFX Homework with JPanes, JButtons and JComponents in Java GUI

Friday, 1 April 2016 /

Create the program with the following functionalities:


  1. Must contain at least one button that changes something on the GUI 
  2. Must contain at least 2 panes 
  3. Must contain at least 6 components (Nodes) 
  4. Must be PG-13 Actually I'm not working on games. Currently.


Output:




Get your work now!


Buy now

Washing Machine Controller GUI in Java programming - Flinders University

Thursday, 31 March 2016 /

Washing Machine

Task

Write a Java program that simulates a washing machine. The graphical user interface consists of two parts: the control panel for setting up washing conditions and the drawing panel for simulating the turbo movement when the machine starts. Note: the example GUI is to illustrate the key interface components rather than suggesting this is the only interface that everyone should stick to. You are encouraged to come up with your own design.

Social Circles, Friend Finder Algorithm in Java full implementation

Friday, 25 March 2016 /

Description

Read a list of friend relations A-B, A-D, C-A, C-D, ..., and determine friendship circles.
2 Problem Statement These days, it seems that we expect computers to direct our social lives, even to the point of choosing our friends. Of course, as programmers, we get to implement these choice algorithms, as in this problem.

Given a \friend relation" { a set of pairs of people who designate each other as \friends"
{ and a particular person (C, \the client") your algorithm is to select any speci ed number
(N) of people who are not friends of C, but who are friends of friends of C. Speci cally, the algorithm picks those people who know the greatest numbers of C's friends. For example,

if N = 2, C is Jack, and the friend relation is
Jack/Mary Mary/Claire Jack/Tom Tom/Claire Jack/Richard
Tod/Richard Claire/Richard Jack/Jill Jill/June June/Tod
Jill/Tod Jill/Peter Mary/Tom Richard/Tom Jill/Tom

the program would select Claire (who knows Jack's friends Mary, Tom, and Richard) and Tod (who knows Richard and Jill). Jack's other friends of friends are June and Peter (who both know Jill). The relationships between Jack's friends (such as Mary and Tom) are irrelevant. Implicitly, Jack is his own friend, so that he is not in the list of suggestions. The \friend" relation is symmetric: you are my friend i (if and only if) I am yours.

The input will consist of multiple sets of data in free format. Each set begins with an
integer, N, and a name (consisting of a string of non-whitespace characters), C. There
then follows a sequence of an even number of names, each successive pair of which denotes a friend relationship. A given friend relationship will appear only one in the sequence (with either member rst). The implicit friendship of a person with himself will not be included.

The sequence terminates with two asterisks (separated by whitespace). For each input set, the output consists of a list of whitespace-separated names in alpha-betical order giving the N non-friends of C who are acquainted with the most friends of C. You may assume that there will always be at least N non-friends of C. In case too many people know the smallest qualifying number of friends, choose those that come earlier in
alphabetical order. Thus, if N = 2 and Mike knows two of C's friends while Sam, Jill, and
Mary know one, then choose Jill and Mike.

Example

Input:
2 Jack
Mary Claire Jack Tom Tom Claire Jack Richard
Jack
Mary
Tod Richard Claire Richard Jack Jill Jill June June Tod
Jill Tod Jill Peter Mary Tom Richard Tom Jill Tom
* *
3 Jack
Mary Claire Jack Tom Tom Claire Jack Richard
Jack
Mary
Tod Richard Claire Richard Jack Jill Jill June June Tod
Jill Tod Jill Peter Mary Tom Richard Tom Jill Tom
* *
Output:
Claire Tod
Claire June Tod

Buy now

Bank Line Implementation in Java using Multi threading - ITEC 3150, Spring, 2016

Friday, 18 March 2016 /
Implement a bank line of credit account.  The account will have two primary attributes, the credit limit and current credit balance.  The line of credit class should also contain a lock and a sufficient credit limit condition.  When initialized the current credit balance will be zero.  The credit limit should be determined at construction time.  The owner of the credit line can get money up to the credit limit and make payments until the balance is zero.   If a request is made for money than is available, the credit limit will return up to the limit, but not beyond it.  So the getMoney method should have a return value of how much money is returned.

CS 211 Project 3: Cipherous Symmetry full solution with JUnit Testing, Encryption and Decryption

Wednesday, 2 March 2016 /

Class Alphabet


Alphabet represents the set of characters that will be allowed in some message. For different messages, we can choose to use different Alphabet objects.
The primary function of Alphabets is to provide the translation of characters from symbols to integers and back via its indexOf(c) and get(i) methods. Several ciphers will require translating a character like 'C' into a number. The Alphabet provides such a functionality via its a.indexOf('C') method which will produce the integer associated with C if the letter is in the alphabet. Similarly, converting a number like 8 to an equivalent character is done via a.get(8) which returns a character from the alphabet.

CS 211 Lab 5: Output, Inheritance, Censorship

Sunday, 21 February 2016 /

CensoredWriter Overview

Occasionally in history there has arisen the need to censor communications. An automatic means of doing this is to scan output and block or replace certain key words that appear. We will set up a class CensoredWriter which performs this task: any output that contains a specified string pattern will have the pattern replaced by a censor string.

2015 Fall Computer Science I Program #3: Mastermind

/ No Comments

Introduction

In the popular game Mastermind, one player creates a secret code of four pegs, each of which can be chosen from one of six colors. (The number of pegs and colors may be different than this in different versions, but your implementation will use these values, but be extendible to other values. Also, a color can be reused, thus there really are six choices for each of the four pegs.) The other player then has to guess the color of each peg, with the order mattering.The player who made the secret code then has to give feed back to the player guessing. This feedback is in the form of white and black pegs. A black peg means that the guesser has chosen the correct color in the correct slot.

Simple GUI Interface

Monday, 15 February 2016 / No Comments

Overview


Order your source code only for $5