Just to be clear, anyone who was exempted from the final NEEDS to still submit the final homework assignment.

It’s an important one, and you need to show me you can code.

If I don’t get a submission by the final, you’re grade will not be an A.

Skip to content
# Category: CSC-111

## Final Homework Assignment

## HW10 Quadratic Equations with Solution

## Due Friday, December 13, 11: 59pm

## CSC-111 Exam #4 Stats with Solution

## CSC-111 Final Exam Date

## Exam is a 70 Question Multiple Choice Exam on Chapters 2 through 9

## HW9 – The Bean Machine with Solution

## Due: Friday, November 22 11:59pm

## Two Dimensional Array Examples

## Exam #4 on Friday, December 6

## State Data Retrieval Systems

## Lucky for Life Lottery Number Generator

## HW8 Computing Standard Deviation with Solution

##### Solution

## Due: Friday, November 15 11:59pm

## Random Array Exercises

## The Game of Craps Analyzed

## codingbat.com

## HW7 Calculate sin(x) or cos(x) using loops and methods with Solution

## Retake Due: Wednesday, Nov. 6 10:00am

## Due: Friday, Nov. 1, 2019 11:59pm

## Solution

## CSC-111 Exam 3 Stats

## In class Method Exercise

## Deck Of Cards Code Using Methods

## CSC-111 Array Motivation Examples

## HW6 ISBN-13 Generator with Solution

## Exam #3 on Friday, Nov 1

## CSC-111 In Class Looping Exercise

## Due: 12:00pm today

## Collatz Conjecture

## Exam 2 Stats and Answers

## HW5 Check SSN Problem with Solutions

## Solutions: https://gist.github.com/bytecodeman/fe5ff16136c317e13120a1c91618a7dc

## Due: Tuesday, Oct 15 11:59pm

## CSC-111 Chapter 5 Looping Extra Programs

## CSC-111 In-class Exercise FizzBuzz with Solution

## CSC-111 Exam #2 Tuesday Oct. 15

# Let’s have our next exam covering chapters 3 and 4 on Tuesday, Oct. 15. It will be an in class exam.

## Authenticate a User Code

## CSC-111 Exam 1 Stats and Answers

## CSC-111 If statement examples and sample code

## In class Chapter 3 Challenge

## Oracle Releases Java 13

## Rules for Homework!!!

### A few things apparently need to be explicitly stated as far as homework is concerned.

### In case things are not mentioned in the homework, the following criteria ALWAYS apply:

## Exam #1 Friday, September 27

## Is Java TOO Hard to Learn

## CSC-111 In Class Chapter 2 Exercise

## Amazon Corretto – Amazon’s Version of the JDK

## CSC-111 Homework 1

**Due Friday, Sept 13 11:59pm.**

## Solution:

## CSC-111 – Counting Bytes

## CSC-111 Course Syllabi

## Java Homework 0

## Required Textbook for Silvestri’s Java Classes

## Welcome to Fall 2019 – Prof. Silvestri’s Programming Courses

Supports classes taught by Prof. A.C. Silvestri

Just to be clear, anyone who was exempted from the final NEEDS to still submit the final homework assignment.

It’s an important one, and you need to show me you can code.

If I don’t get a submission by the final, you’re grade will not be an A.

Design a class named Quadratic for a quadratic equation ax^{2} + bx + c = 0.

The solution to the quadratic equation is given by this formula:

The class contains:

- Private data fields a, b, and c that represent three coefficients.
- A constructor with arguments for a, b, and c.
- A method named
**noOfRoots**() that returns the number of real roots for the quadratic, either 0, 1, or 2 - Methods
**getRoot1**() and**getRoot2**() that returns the roots. These methods are useful only if the noOfRoots is nonnegative.

Download this driver class to test your implementation: QuadraticDriver.java **(Do Not Change the Driver at all.)**

Min Raw Score: 16

Max Raw Score: 34

Ave Raw Score: 26.12

Scaled Grade: 100 * (RawScore) / 35 + 6

- Monday, December 16, 10:10am-12:00pm.

Please code problem 7.21 (Game: Bean Machine) in the textbook. Make sure you use the template.

Here are screen shots of the problem:

**For 5 big bonus points (Total of 15 out of 10) Make a vertical histogram.**

Let’s have our next exam covering just chapters 7 and 8. So start studying as we progress through the material.

**It is a multiple choice exam so come early to class and bring a pencil.**

Go here for sample quizzes:

Write an application to help choose the Lucky for Life

lottery numbers.

The Lucky for Life Numbers follow these rules:

- Pick a group of 5 numbers from the numbers 1 to 43, inclusive
**(NO DUPLICATES!)** - Pick 1 number (the LUCKY BALL number) out of the numbers 1 to 43. This one number can duplicate one of the 5 already picked above. This Lucky Ball number is totally independent of the group of 5 picked above.

Your application should prompt for the number of quick picks desired. It will then generate and output that many Lucky of Life numbers.

**The group of 5 numbers in each quick pick must be sorted. The lucky ball is printed after the group of 5.; it is not involved in the sort.
**

Make sure your generator program keeps generating these numbers by asking the user if they would like to run the generator again. Use the Project Template. In fact, use this template for all future assignments as well.

Happy Computing!

Problem 7.11 (Computing Deviation) page 278. Write your program to read a data file. You’ll prompt for a filename and use that name to open and read a data file. You may either read the data off your machine’s hard drive as a file, or read it from a website. Assume the data file has an integer as its first number that indicates the number of data points that follow in the file. Here is some sample code to read the data: Sample Data File Reading Code

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. Download and copy them into your project folder. They are also located on my website: https://cs.stcc.edu/~silvestri/csc111/

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

Make an account and try out the examples.

Thx to Anna for showing me the site.

Do the cosine series as opposed to the sine. Same requirements as the original sine assignment.

Write an application that uses the template 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)

Min Raw Score: 12

Max Raw Score: 44

Ave Raw Score: 28.85

Scaled Grade: 100 * (RawScore) / 45+ 10

Let’s have exam#3 covering just chapters 5 and 6 on Friday, Nov. 1. **It is a multiple choice exam so come early to class and bring a pencil.**

Go here for sample quizzes:

Write code that keeps prompting for a positive number. When it gets that positive number, it keeps track of the largest positive number it finds.

If a negative number is entered, quit the process and print out the largest positive number.

Copy and Paste this code to get you started:

// Put your name here import java.util.Scanner; public class FindMaximumValue { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.print("Enter a positive number: "); int max = input.nextInt(); if (max < 0) { System.out.println("Can't Do this problem."); System.out.println("You can't follow directions."); } else { // Now write code that keeps prompting // for a positive number and keeps track // of the largest positive number it finds. // ... } input.close(); } }

Min Raw Score: 15

Max Raw Score: 48

Ave Raw Score: 32.1

Scaled Grade: 100 * (RawScore) / 50 + 10

- 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!

Due in class only!!!

A classic interview question used by companies to see if a potential employee can really program is the FizzBuzz problem.

Enter a number. If the number is divisible by 3, output “Fizz”. If it is divisible by 5, output “Buzz”. If it is divisible by 3 and 5, output “FizzBuzz”. If the number doesn’t meet any of the divisibility rules, simply output the number.

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

Go here for sample quizzes:

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, print: “Credentials Not Correct. Access Denied!!!”

Min Raw Score: 17

Max Raw Score: 57

Ave Raw Score: 40

Scaled Grade: 100 * (RawScore) / 65 + 10 (When you receive your answer sheet, add up both sides for raw score.)

CSC111 Exam1 With Answers (Answers are on the last page.)

(Game: pick a card) Write a program that simulates picking a card from a deck of 52 cards. Your program should display the rank (Ace, 2, 3, 4, 5, 6, 7, 8, 9, 10, Jack, Queen, King) and suit (Clubs, Diamonds, Hearts, Spades) of the card.

Here is a sample run of the program:

The card you picked is Jack of Hearts

- Code needs to be written using the JDK 8 or better.
- Code needs to contain the global header information mentioned in the syllabus. All source code files must have the global header.
- Code must be formatted properly using Eclipse’s formatting capabilities.
- Code must use methods and classes to separate the logic. (To be done soon)
- Always email me
**gists**of your source code. - No homework will be accepted after due date and time. Submit your homework on time.

Let’s have our first exam covering chapters 1 and 2 on Friday, 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 know it, study it!

__Solution to the Population Problem 1-11__ or __Solution to the Population Problem 1-11 With Variables__

This problem is on page 31 in the textbook.

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.

Install Java 10 JDK and eclipse on your personal computers.

Note that lab is not required. I will be in my office during the lab times for at least the first 50 minutes.

**Introduction to Java Programming and Data Structures, Comprehensive Version, 11/E
**Y. Daniel Liang

ISBN-10: 0134670949

ISBN-13: 9780134670942

Publisher: Pearson

Copyright: 2018

*(Book is used for 3 semesters: CSC-111, CSC-112, & CSC-220)*

All course announcements and correspondence will be done through this page. It is your responsibility to visit this course page at least once every two days to view the latest course announcements, homework, and news. It is unacceptable to say that you are not aware of something happening in the course.