CSC-220 HW3 Two-Dimensional Array Problem

Due: Friday, Sept. 28, 2018 11:59pm

You work for NASA in their Space Center Laboratory.  You are asked to write a JAVA program that takes an array containing the digitized picture of the night sky and locate the star(s) in it. Each element of the array represents the amount of light hitting that portion of the image when the picture was taken. Intensities range from 0 to 20.

Here is a sample of this data:

 0  3  4  0  0  0  6  8
 5 13  6  0  0  0  2  3
 2  6  2  7  3  0 10  0
 0  0  4 15  4  1  6  0
 0  0  7 12  6  9 10  4
 5  0  6 10  6  4  8  0

A star is most likely located in the area covered by the array element [i][j] if:  (array[i][j] + sum of the 8 surrounding intensities)/5 > 6.0

Ignore possible stars along the edges of the array.

Output should be a character array with asterisks printed at the coordinates of where a star might possibly be.  ie:

+---+---+---+---+---+---+---+---+
|   |   |   |   |   |   |   |   |
+---+---+---+---+---+---+---+---+
|   | * |   |   |   |   |   |   |
+---+---+---+---+---+---+---+---+
|   |   |   |   |   |   |   |   |
+---+---+---+---+---+---+---+---+
|   |   |   |   |   |   |   |   |
+---+---+---+---+---+---+---+---+
|   |   |   | * |   |   |   |   |
+---+---+---+---+---+---+---+---+
|   |   |   |   | * |   | * |   |
+---+---+---+---+---+---+---+---+
|   |   |   |   |   |   |   |   |
+---+---+---+---+---+---+---+---+

(Don’t read into the star pattern too much.  I ball parked where the stars would be based on the data given above.)

Your program should have a method that reads in the star data and returns a 2D array of ints. i.e.:

static int[][] readStarData(Scanner sc);

You should have a method that analyzes this data to produce a 2D array of characters.  This array contains a space or an asterisk depending on the calculation made for row I, column j.  ie:

static char[][] analyzeStarData(int stardata[][]);

Output a nice character grid similar to what was shown above to display the star pattern. Please include the character borders. ie:

static void outputStarData(char pattern[][]);

Use the template as always.

Here is the data file to use: StarData.txt

Happy Coding …

CSC-111 Exam #1 Thursday, September 27

Let’s have our first exam covering chapters 1 and 2 on Thursday, Sept. 27.  It will be an in class exam.

CLOSED BOOK/CLOSED NOTES.  COME EARLY TO CLASS AND BRING A PENCIL.

Go here for sample quizzes:

https://media.pearsoncmg.com/ph/esm/ecs_liang_ijp_11/cw/

Even though we didn’t go into too much detail in Chapter 1, that material is essentially Computer Concepts and is something you should already know.  If you don’t study it!

CSC-220 HW2 Arrays Assignment

Due: Friday, Sept. 21, 2018  11:59pm

Given two strings s and t, determine if they are isomorphic.

Two strings are isomorphic if the characters in s can be replaced to get t.

All occurrences of a character must be replaced with another character while preserving the order of characters. No two characters may map to the same character but a character may map to itself.

Example 1:
Input: s = “egg”, t = “add”
Output: true

Example 2:
Input: s = “foo”, t = “bar”
Output: false

Example 3:
Input: s = “paper”, t = “title”
Output: true

Requirements

Incorporate the Project Template for those writing a command line program.  CSC-112 graduates can write a GUI to do this problem for extra credit.  Don’t forget that knowledge. 

Warning

Only use the material up to and including Chapter 7 on single dimension arrays.  If you include data structures that are beyond what we covered, then you will be asked to demo your code to class and explain its operation.

Hint:

To convert a string to an array, use the String .toCharArray() method.


CSC-111 HW2 Calculate Temperature, Dewpoint, or Relative Humidity

Due: Saturday, Sept 22, 11:59pm

Create a program that inputs the 3 sets of 2 inputs needed to calculate Actual Temperature, Dewpoint, and Relative Humidity. For instance, entering Actual Temperature and Dewpoint will calculate the corresponding Relative Humidity. Entering Actual Temperature and Relative Humidity, calculates Dewpoint. Finally, entering Dewpoint and Relative Humidity, allows calculation of Actual Temperature.

Use the Scanner class for your input. To be clear, you will submit just one program that will have a total of 6 input methods and 3 calculations and outputs.

Use this website: http://andrew.rsmas.miami.edu/bmcnoldy/Humidity.html for the necessary formulas. That page also has a calculator, you can use to check your own calculations.

All the temperatures in the equations are based in Celcius.  We live in a Fahrenheit world.  Please input and output temperatures in Fahrenheit.

Your outputs should be neatly formatted and annotated. Output 3 decimal digits.

Note: Just use the topics discussed in chapter 2, or what was discussed in class.  No methods, loops, if statements should be coded.

Hint:

References in the formulas to

  • exp(expr) is Math.exp(expr) in Java
  • ln(expr) is Math.log(expr) in Java

CSC-220 Chapter 7 Searching and Sorting Examples

Sorting and Searching V1:
http://pastebin.com/Mrryf839

Sorting and Searching V2 using Arrays methods:
http://pastebin.com/Sk7e5GtX

Sorting Using BinarySearch routine (updated 9/17/18):
https://gist.github.com/bytecodeman/2375a479f829025dfe643b2c785a65fc

String Sorting:
http://pastebin.com/D57LPbB9

String Sorting V2 With Interfaces and Lambdas
https://pastebin.com/pV1sgRq8

CSC-220 HW1 (Emirp)

Let’s do problem 6.27 (Emirp) shown here:

DUE: Friday, Sept 14 11:59pm

Here is a gist of the solution to 6.26 discussed in class:
https://gist.github.com/bytecodeman/3413b5197a7663b0eee742aa144cdda2

Incorporate the Project Template for those writing a command line program.  CSC-112 graduates can write a GUI to do this problem for extra credit.  Don’t forget that knowledge. 

The template provides a way to run the code over and over again without having to restart the program.  For each run, prompt for the starting point for the emirp analysis and how many emirps you want to find from that starting point.

Pre-Alg Class Announcement

First, let me apologize for the first day confusion. 

I called the IT helpdesk, and they actually came down quickly to resolve the problems.

On Friday, Sept 7, let’s meet in our regular room 17/403.  I’ll show you the website that we’ll use, and I show you how to register for it.

We’ll even do some math!  Go figure…

Here’s the website:  https://cs.stcc.edu/prealg

See you Friday!!!

Supplemental Instruction (SI)

The college has a new program called Supplemental Instruction (SI). Through this program, you will have the opportunity to meet weekly with our SI Leader, who will provide weekly review sessions for all interested students. The Leader is a current student who has recently taken the course and done well. They will be in class with you every day, hearing what you hear, and reading what you read. During each review session, you will have a chance to get together with your classmates to compare notes, discuss concepts that might be confusing, review material for tests and quizzes, and ask any questions that you might have.

Sessions will begin the week of September 11th, and run through the end of the semester. You can attend as many review sessions as you like; each one will be different because you will have new material to discuss. SI sessions are informal – bring any notes you have, your textbook, or a classmate! By coming to these sessions, you will be able to develop a better understanding of the course content as well as more effective ways of learning.

If you are unable to attend the group session, but would like to meet with the SI Leader, you can set up an individual time to meet with them. You can let them know you would like to make an appointment with them when you see them in class, or feel free to send them a note through their college email.

I am thrilled that we have this new opportunity for you, and I am hopeful that you take advantage of this program.

Our SI leader is Joseph Santos and his email address is: joesantosjava.si@gmail.com

CSC-111 Homework 1

Due Tuesday, Sept 11  11:59pm.

This problem is on page 31 in the textbook.

prob1-11

Do this problem without using variables, loops, or anything beyond what is discussed in Chapter 1. You’ll have a better appreciation for these advanced tools once you do the problem without them.

You need to submit a gist link to silvestri@stcc.edu of your code by the due date and time.

 

 

Math – Silvestri’s Special Apps Center!

Check out:   https://cs.stcc.edu/specialapps/

I have some ideas for apps to add to this website, so please visit every now and then.

If you have an idea for an app that you think would be useful, would benefit a student, or would make the world a better place, please share ( silvestri@stcc.edu ), and if it isn’t too involved, and I have the time, I’ll code the problem and make it a special app.

PreAlg – Welcome to Professor Silvestri’s Pre-Algebra Course

  • There are math lecture videos based on our textbook.  You can access them here:    Pre-Algebra Videos   (This is STCC’s portal website.  You’ll need to login with your Webadvisor credentials.) If you miss a class or need another prospective on the material, give these videos a try.
  • To take these courses, you must have access to a computer as this will be a hybrid lecture / online study course.  We will be using http://www.mymathlab.com/. So you must purchase the Student Access Code package and register using the appropriate Course Code (ID) shown above.
  • (Free Textbook)  Bedinelli Basic Mathematics Text Book

Algebra – Welcome to Professor Silvestri’s Algebra Courses

  • There are math lecture videos based on our textbook.  You can access them here:    Algebra Videos      (This is STCC’s portal website.  You’ll need to login with your Webadvisor credentials.) If you miss a class or need another prospective on the material, give these videos a try.
  • To take these courses, you must have access to a computer as this will be a hybrid lecture / online study course.  We will be using http://www.mymathlab.com/. So you must purchase the Student Access Code package and register using the appropriate Course Code (ID) shown above.
  • (Optional Textbook) Introductory Algebra through Applications, 3rd Edition, Akst and Bragg, 2012, Pearson Education, ISBN: 9780321746696

algebratext

CSC-220 – Supplemental Video Course Series

Optional resources, but highly suggested supplements for this course.  I’ll be using these video series as a supplement to my lectures this semester:

These courses can be purchased for as little as $9.99.  Not bad!

CSC-111 – Introduction to Java Programming for Online Learners

An optional resource but highly suggested supplement for this course.  I’ll be using this video series to supplement my lectures.  I’ll also be using the videos as the basis for an online Intro to Java course that will hopefully be running Spring 2019:

Udemy Course – Introduction to Java Programming for Online Learners

This course can be purchased for as little as $9.99.  Not bad!

Links and Resources for Java Courses

Liang 11th Edition Resources

Common Resources

Sign up for a GitHub Account

If you going to be a programmer, then github is a site you’ll need to use.

Go here: https://github.com/ and create an account for yourself.  We will be using github for homework submissions.

In particular the part of github we’ll  be using is the gist function located here:

https://gist.github.com/

You can submit multi-file projects under just one URL! You also have a record of all your work in one convenient location.