CSC-111 HW8 Computing Deviation

Due: Tuesday, November 27 11:59pm

Problem 7.11 (Computing Deviation) page 278.  Write your program to read a data file. You’ll prompt for a filename and you’ll use that name to open and read a data file.  Assume the data file has an integer as its first number that indicates the number of data points that follow in the file.

Make sure you use the Application Template so you can process multiple data files.  Code as many methods as you can that make sense to create this application.

Here are 3 different data files:

These data files were generated from a website: https://random.org/

problem7-11

 

Last Day to Withdraw From Classes

Tuesday, November 27.

If you haven’t been keeping up with the work, have a low grade average, or have missed a multitude of classes, please drop the class. I will issue a failing grade if your average is below a 60.

If the course has an associated lab, please drop that as well.

Unless you have a medical issue that can be verified by the Dean of Students, there are no extensions, extra work, or any other way for you to extend this semester.

CSC-220 HW7 Recursion Homework With Solution

Solution by A.C. Silvestri

Problem inspired by this article: https://medium.freecodecamp.org/how-to-impress-interviewers-by-using-recursion-in-javascript-with-es6-features-a14c763110d7

Due: Wednesday, Nov. 14, 11:59pm

Using recursive techniques only!

Write a function that takes as input a String and returns a “report” on the frequency of characters in the String.

ie input: “bbbdaacccced”

output: [{‘b’, 3}, {d, 2}, {c, 4}, {a, 2}, {e, 1}]

The “report” needs to be an ArrayList and each element of the ArrayList is a class that wraps a character and its count.  Much like a “BabyName”?

Do not give me a solution that doesn’t involve an ArrayList.

Of course, use the template.


CSC-111 HW7 Calculate sin(x) using loops and methods with Solution

Solution by A.C. Silvestri

Due: Tuesday, Nov. 13, 2018 11:59pm

Write an application that calculates the sin(x).  The sin(x) can be calculated using the following series:

A program consisting of only a main method will not get you a passing grade.  You must break up your logic into as many methods as necessary to solve this problem.  The more methods, the better the grade.

At the very minimum, for each run of the logic, you will prompt the user for x (in degrees).  Remember, the series requires x to be in radians.  (Use Math.PI / 180 as your conversion factor.)  You will also prompt the user for the number of terms to calculate in the series.  You’ll output your series calculation, as well as Math.sin(x), and the difference between the two values to see how close your calculation is.

At the end of your logic, you’ll ask the user if they want to repeat the calculations.

Your grade will be based on the following criteria:

  • how much of the application is finished
  • whether it works
  • if you coded methods
  • the number of methods
  • if you formatted the output values using the printf method (assume just 6 decimal places for the output display)

Algebra 2 – Progress as of Tuesday, November 13

As of Tuesday, November 13, we finished Chapter 8A.

To give you an accurate reflection of what your grade is as of now, all work that should be completed, but isn’t, has been issued a zero.  Your grade average in mymathlab will reflect that.  Now of course if you do those homeworks and quizzes, whatever grade you get will overwrite the zero.  So get that work done!

7 students have not attempted Exam 2 yet.  What are you waiting for?  Remember this class is done when the semester is over.  There are no extensions, no excuses.

On Thursday, November 15 we’ll finish Section 8.3 and on Tuesday, Nov 19 we’ll finish Section 8.4, just before Thanksgiving break.  You should do quiz 8B over the break.

PreAlg – Progress as of Friday, October 26

As of Friday, October 26, we finished Chapter 6.  On Monday, October 29, we will do a Sample Exam #2 as a review.  This exam covers Chapters 4, 5, and 6.  You should complete all Chapter 4, 5, and 6 homeworks and quizzes by Monday, Oct. 29.

To give you an accurate reflection of what your grade is as of now, all work that should be completed, but isn’t, has been issued a zero.  Your grade average in mymathlab will reflect that.  Now of course if you do those homeworks, quizzes, and tests, whatever grade you get will overwrite the zero.  So get that work done!

Exam 2 will be enabled after the review on Oct 29. It will be due Saturday, November 3 at 11:59pm. You have two takes; the better grade of the two is used. Remember, if you use a take(s) after the due date, there will be a 10 point deduction from the grade on that take.

Wednesday’s class on October 31 is cancelled. Use can use that time to find a working computer on campus and take the test!


If you find you are too far behind and guilty of not keeping up with the material, instead of failing this class, you can transfer to what is called a self paced class.  You can transfer whatever work you did manage to complete and perhaps get 1 or 2 credits for it.  You won’t be able to continue to Algebra 1, but at least you’ll get some credit for what you did.  In self paced, it is possible to earn 3 credits by studying and doing work on your own.  To go on to Algebra 1 you must either pass a lecture class with a C- or earn 3 credits in self paced.

If this sounds like a good option, please see the staff in the testing center  17/425.  They can help with getting you assigned to a self paced class.

Algebra 2 – Progress as of Thursday, October 25

As of Thursday, October 25, we finished Chapter 7.  We will do a review of Chapter 7 on Tuesday, October 30 by taking a sample Exam 2.  You should complete all Chapter 7 homeworks and quizzes by Tuesday, Oct. 30.

To give you an accurate reflection of what your grade is as of now, all work that should be completed, but isn’t, has been issued a zero.  Your grade average in mymathlab will reflect that.  Now of course if you do those homeworks and quizzes, whatever grade you get will overwrite the zero.  So get that work done!

Exam 2 will be enabled after the review on Oct 30.   It will be due Saturday, November 3 at 11:59pm.  You have two takes; the better grade of the two is used.  Remember, if you use a take(s) after the due date, there will be a 10 point deduction from the grade on that take.

From the syllabus:

Exams can also be taken at home.  They have a due date. Exams submitted before the due date receive full credit. Exams submitted afterward get a 10 point reduction. You get 2 takes on exams. The greater of the two gets entered in the system.

Thursday’s class on November 1 is cancelled.  Use can use that time to find a working computer on campus and take the test!

CSC-220 Exam #2 Friday, Nov. 2

Let’s have our next exam covering chapters 9, 10, and 11 on Friday, Nov. 2. It will be an in class exam.

It’s a Closed Book / Closed Notes Multiple Choice Exam. COME EARLY TO CLASS AND BRING A PENCIL.

Go here for sample quizzes:

https://media.pearsoncmg.com/ph/esm/ecs_liang_ijp_11/cw/login/sign-in.php?dest=https://media.pearsoncmg.com/ph/esm/ecs_liang_ijp_11/cw/index.php

CSC-111 HW5 Check SSN Problem with Solution

Due: Tuesday, Oct 23 11:59pm

Solutions

checkssnSome additional requirements:

  • Enter the SSN as a String.
  • An SSN can have OPTIONAL HYPHENS!  But if they are there, they both need to be in their proper spots. So 123456789 and 123-45-6789 are both valid SSNs.
  • DO NOT USE LOOPS.  We haven’t studied them yet.  If you know loops, this problem will give you an appreciation for them.
  • Use the methods discussed in Chapter 4 as much as possible!
  • To avoid deep nesting of if statements, use a boolean variable and  expressions that look like:
boolean isValid = true;
isValid = isValid && character1 is a digit;
isValid = isValid && character2 is a digit;
. . .
  • Just to give yourself confidence in the expressions involving isValid, write the program assuming an SSN only has 2 digits.  Extending to 9 digits would be trivial.  Adding optional hypen logic would then be marginally harder.

Happy Coding!

CSC-111 Authentication System In-Class Exercise

Prompt for a Username and Password.

The credentials to check for proper access is:

Username: CSC-111
Password: JavaIsGood

Typically a username is checked with case insensitivity. Capital-A and lowercase-a are the same.  Passwords are always case sensitive.

If the user enters the proper info, they are allowed access to the system and you will print out: “Access Allowed”.

If not, you’ll print: “Credentials Not Correct.  Access Denied!!!”

Enjoy

PreAlg – Progress as of Friday, October 12

As of Friday, October 12, we finished Chapter 4.

To give you an accurate reflection of what your grade is as of now, all work that should be completed, but isn’t, has been issued a zero.  Your grade average in mymathlab will reflect that.  Now of course if you do those homeworks, quizzes, and tests, whatever grade you get will overwrite the zero.  So get that work done!

Algebra 2 – Progress as of Thursday, September 27

As of Tuesday, September 25, we finished Chapter 6 and did a review of the chapter by taking a sample Exam 1.  You should have completed all Chapter 6 homeworks and quizzes by Thursday, Sept 27.

To give you an accurate reflection of what your grade is as of now, all work that should be completed, but isn’t, has been issued a zero.  Your grade average in mymathlab will reflect that.  Now of course if you do those homeworks and quizzes, whatever grade you get will overwrite the zero.  So get that work done!

I enabled Exam 1 which covers Chapters 6.  It will be due Saturday, September 29 at 11:59pm.  You have two takes; the better grade of the two is used.  Remember, if you use a take(s) after the due date, there will be a 10 point deduction from the grade on that take.

From the syllabus:

Exams can also be taken at home.  They have a due date. Exams submitted before the due date receive full credit. Exams submitted afterward get a 10 point reduction. You get 2 takes on exams. The greater of the two gets entered in the system.

Thursday’s class is cancelled.  Use that time to find a working computer on campus and take the test!

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.