Questions and Answers
What is the primary function of the Welcome Program?
What does the ASCII Art program display?
What integer value does the Variables program assign to currYear?
2023
What does the Answering Questions program ask the user?
Signup and view all the answers
In the Poetry program, what can the user do?
Signup and view all the answers
What is calculated in the Area of a Rectangle program?
Signup and view all the answers
What must the user input in the Add Fractions program?
Signup and view all the answers
What happens to the double value in Casting to Int program?
Signup and view all the answers
What type of value does the Casting to Double program output?
Signup and view all the answers
In the Movie Ratings program, the movie rating is rounded to the nearest ___
Signup and view all the answers
The Ice Cream program prints whether the user likes ice cream.
Signup and view all the answers
What determines if someone can ride in the Roller Coaster program?
Signup and view all the answers
In the Triple Double program, the user is asked for points, rebounds, and ___
Signup and view all the answers
Study Notes
Welcome Program
- Introduces a simple class
Welcome
that extendsConsoleProgram
. - Outputs personal information using
System.out.println()
.
ASCII Art
- Class
Art
illustrates basic ASCII art creation features. - Utilizes
System.out.println()
for visual text representation.
Our First Integer
-
Variables
class demonstrates integer usage withint currYear = 2023;
. - Displays the current year in the console.
Answering Questions
-
Variables
class showcases multiple variable types:String
,int
,double
, andboolean
. - Outputs a best friend's name, a lucky number, room square footage, and ballet participation status.
About You
- Class
AboutYou
collects user input for favorite food, color, and movie throughreadLine()
. - Displays collected input on the console.
Poetry
- Class
Poetry
combines static text printing with user-generated content. - Prompts user to write a poem and then displays it.
Area of a Rectangle
-
Area
class prompts for rectangle dimensions usingreadDouble()
. - Calculates and displays the area of the rectangle in square units.
Add Fractions
- Class
AddFractions
helps compute the sum of two fractions. - Uses user input for numerators and denominators, calculates the sum, and formats the output.
Casting to an Int
-
CastingToInt
class demonstrates type casting fromdouble
toint
. - Displays the integer value of a double with a truncation feature.
Casting to a Double
- Class
CastingToDouble
illustrates type casting fromint
todouble
. - Computes the quotient of two integers as a double for accurate division.
Movie Ratings
- Class
MovieRatings
takes a movie rating from the user. - Demonstrates rounding technique to the nearest integer after adding 0.5.
Ice Cream
-
IceCream
class gathers user preferences regarding ice cream with a boolean input. - Outputs user response directly to the console.
Roller Coaster
- Class
RollerCoaster
checks eligibility for riding based on height and age. - Combines boolean conditions to determine if the user can ride and outputs the result.
Triple Double
- Class
TripleDouble
collects user statistics: points, rebounds, and assists. - Intended to use boolean logic for further calculations, although incomplete.
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.
Description
This quiz covers CodeHS Unit 2 flashcards, focusing on key programming concepts like the Welcome Program and ASCII Art. Each card includes code snippets for better understanding. Test your knowledge and understanding of these basic programming structures!