Coder Social home page Coder Social logo

swosu / listing_4_16_1411_project Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jeremy-evert/listing_4_16_1411_project

0.0 4.0 0.0 64 KB

Generate a random charachter that is uppercase and uses the Math.random() method, as well as a custom method.

Java 100.00%

listing_4_16_1411_project's Introduction

Listing_4_16_1411_Project: How to generate a random upper case letter.

Introduction

This document details the generation of a Java program that writes an uppercase letter to the console. This code is managed inside Github.com and uses the Math.random() method as well as a custom method call.

Outline

// Generate a random uppercase letter (using a custom method call)
// Print the random letter to the console.

References and Literature

// Liang Java 10th edition. Pg 87, Listing 3.3 // This is an example of how to make a random number. // int number1 = (int)(Math.random()*10);

// Liang Java 10th edition. Pg 125, Table 4.4 // We can map from integers to Capital letters // Characters ‘A’ to ‘Z’ have a Value in Decimal of 65 to 90.

// Liang Java 10th edition. Pg 122, 4.2.5 the random method. // a + Math.random() * b // returns a random number between a and a+b, excluding a+b.

// Liang Java 10th edition. Pg 209, 6.4, void Method Example. // This shows how we can set up a method call.

Code

Console

Command Prompt

  1. Open Eclipse and start new project a. may need to change to your workspace

  2. Go to Github and start a new repository.

  3. Use the command prompt to make the connections.

a. Navigate to the correct location. Looking for src and bin folders.

Move to the E: drive:

C:\Users\LAB>E:

dir shows what is in the directory.

E:\>dir
 Volume in drive E has no label.
 Volume Serial Number is CF21-6DC3

 Directory of E:\

10/09/2015  08:03 AM    <DIR>          COMSC_1033_Workspace
10/13/2015  11:53 AM    <DIR>          COMSC_3603
10/18/2015  04:09 PM    <DIR>          Github_Workspace
10/29/2015  10:25 AM    <DIR>          COMSC_3603_Workspace
               3 File(s)     16,394,783 bytes
              14 Dir(s)   8,059,305,984 bytes free

cd COMSC_1033_Workspace Changes to the correct eclipse workspace.

E:\>cd COMSC_1033_Workspace

E:\COMSC_1033_Workspace>cd Listing_4_16_1411_Project

Use dir again to make sure we can see the src and bin files.

E:\COMSC_1033_Workspace\Listing_4_16_1411_Project>dir
 Volume in drive E has no label.
 Volume Serial Number is CF21-6DC3

 Directory of E:\COMSC_1033_Workspace\Listing_4_16_1411_Project

11/02/2015  09:14 AM    <DIR>          .
11/02/2015  09:14 AM    <DIR>          ..
11/02/2015  09:14 AM               401 .project
11/02/2015  09:14 AM    <DIR>          src
11/02/2015  09:14 AM    <DIR>          bin
11/02/2015  09:14 AM               232 .classpath
               2 File(s)            633 bytes
               4 Dir(s)   8,059,305,984 bytes free

E:\COMSC_1033_Workspace\Listing_4_16_1411_Project>

And now we add the readme file. This is the start of directions from Github.

E:\COMSC_1033_Workspace\Listing_4_16_1411_Project>echo # Listing_4_16_1411_Proje
ct >> README.md

Continue to work through the instructions online.

Initialize our repository.

E:\COMSC_1033_Workspace\Listing_4_16_1411_Project>git init
Initialized empty Git repository in E:/COMSC_1033_Workspace/Listing_4_16_1411_Pr
oject/.git/

Add our files to the staging area.

E:\COMSC_1033_Workspace\Listing_4_16_1411_Project>git add .

Configure our user name and password.

E:\COMSC_1033_Workspace\Listing_4_16_1411_Project>git config user.name "Jeremy E
vert"

E:\COMSC_1033_Workspace\Listing_4_16_1411_Project>git config user.email "jeremy.
[email protected]"

Commit our changes.

E:\COMSC_1033_Workspace\Listing_4_16_1411_Project>git commit -m "first commit"
[master (root-commit) ba507c7] first commit
 5 files changed, 29 insertions(+)
 create mode 100644 .classpath
 create mode 100644 .project
 create mode 100644 README.md
 create mode 100644 bin/Listing_4_16_1411.class
 create mode 100644 src/Listing_4_16_1411.java

Make the connections between our repository and Github.

E:\COMSC_1033_Workspace\Listing_4_16_1411_Project>git remote add origin https://
github.com/jeremy-evert/Listing_4_16_1411_Project.git

E:\COMSC_1033_Workspace\Listing_4_16_1411_Project>git push -u origin master
Username for 'https://github.com': [email protected]
Password for 'https://[email protected]@github.com':
Counting objects: 9, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (8/8), done.
Writing objects: 100% (9/9), 1.27 KiB | 0 bytes/s, done.
Total 9 (delta 0), reused 0 (delta 0)
To https://github.com/jeremy-evert/Listing_4_16_1411_Project.git
 * [new branch]      master -> master
Branch master set up to track remote branch master from origin.

E:\COMSC_1033_Workspace\Listing_4_16_1411_Project>

listing_4_16_1411_project's People

Contributors

jeremy-evert avatar

Watchers

James Cloos avatar  avatar Jaclyn Hammond 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.