Winter 2023 Course Updates and Reminders

 
CSE 121
 
Elba Garza
Winter 2023
 
Music: Juice - Lizzo
 
Announcements, Reminders
 
Quiz 2 - 
February 23
rd
 – 24
th
, 00:01 to 23:59 (
TONIGHT!
)
Take-home, same exact format as usual, and no longer!
Open for 48 hours, start any time & given 1.5 hours
 
to finish;
Accommodations still apply.
No retakes though!
Can work together; 
must
 state with whom!
Will send out more information (logins/links/etc.) tonight!
Creative Project 3 out tonight; due February 28
th
 at 11:59 PM
Resubmission Form for R5 out soon; due February 28
th
 by 11:59 PM
 
Lesson 14 - Winter 2023
 
2
 
Announcements, Reminders
 
Quiz Retake on Tuesday, February 28th:
Retake Form out soon; due Sunday Feb 26
th
 at 11:59 PM
Eligible Quizzes:
Quiz 1 - 3rd and 
final
 opportunity!
Quiz 0 retakes grading… sorry, didn’t get to it this weekend! 
🥺
 
Lesson 14 - Winter 2023
 
3
 
User Input
 
Scanner
 class
Methods:
console
.next()
 - 
asking the user for 
one singular token
 
as input.
Token: a unit of input separated by some 
whitespace (e.g.
space, tab, newline!)
console
.nextLine()
 - input that 
can be multiple
 words
,
separated by spaces!
console
.nextInt()
 - asking the user for an 
int
 value as input
console
.nextDouble()
 - asking the user for a 
double
 value as
input
If methods don’t receive correct input → Exception!
 
Last Time
 
Lesson 14 - Winter 2023
 
4
 
File Input/Output
New class used: 
File
 (need to warn about exceptions!)
Need to import 
java.io.*
Scanner
 Methods using 
File
s:
fileScan
.hasNext()
 - Returns 
true
 if the 
Scanner
 contains another token of
input, returns 
false
 otherwise.
fileScan
.hasNextInt()
/
hasNextDouble()
 - Returns 
true
 if the 
Scanner
’s
next token of input is a(n) 
int
/
double
, returns 
false
 otherwise.
fileScan
.hasNextLine()
 - Returns 
true
 if the 
Scanner
 contains another line of
input, returns 
false
 otherwise.
fileScan
.next()
 - Scans and returns the next token of input from this 
Scanner
.
fileScan
.nextInt()
/
nextDouble()
 - Scans and returns the next token of input
from this 
Scanner
 as a(n) 
int
/
double
.
fileScan
.nextLine()
 - Scans and returns the next line of input from this 
Scanner
.
 
Plan for Today
 
Lesson 14 - Winter 2023
 
5
 
Scanner
 
fileScan
 = 
new
 Scanner(
<File object>
);
Slide Note
Embed
Share

Stay up-to-date with the latest announcements for CSE 121 taught by Elba Garza in Winter 2023. Quiz deadlines, creative project due dates, resubmission forms, and retake opportunities are highlighted. Learn about user input methods in Java programming and essential Scanner class methods. Get ready for file input/output tasks using the Scanner class. Be prepared for the upcoming challenges in your course!

  • Winter 2023
  • CSE 121
  • Elba Garza
  • Announcements
  • Reminders

Uploaded on Sep 08, 2024 | 1 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.

E N D

Presentation Transcript


  1. CSE 121 Elba Garza Winter 2023 Music: Juice - Lizzo

  2. Announcements, Reminders Quiz 2 - February 23rd 24th, 00:01 to 23:59 (TONIGHT!) Take-home, same exact format as usual, and no longer! Open for 48 hours, start any time & given 1.5 hours to finish; Accommodations still apply. No retakes though! Can work together; must state with whom! Will send out more information (logins/links/etc.) tonight! Creative Project 3 out tonight; due February 28that 11:59 PM Resubmission Form for R5 out soon; due February 28thby 11:59 PM Lesson 14 - Winter 2023 2

  3. Announcements, Reminders Quiz Retake on Tuesday, February 28th: Retake Form out soon; due Sunday Feb 26that 11:59 PM Eligible Quizzes: Quiz 1 - 3rd and final opportunity! Quiz 0 retakes grading sorry, didn t get to it this weekend! Lesson 14 - Winter 2023 3

  4. Last Time User Input Scanner class Methods: console.next() - asking the user for one singular token as input. Token: a unit of input separated by some whitespace (e.g. space, tab, newline!) console.nextLine() - input that can be multiple words, separated by spaces! console.nextInt() - asking the user for an int value as input console.nextDouble() - asking the user for a double value as input If methods don t receive correct input Exception! Lesson 14 - Winter 2023 4

  5. Scanner fileScan = new Scanner(<File object>); Plan for Today File Input/Output New class used: File (need to warn about exceptions!) Need to import java.io.* Scanner Methods using Files: fileScan.hasNext() - Returns true if the Scanner contains another token of input, returns false otherwise. fileScan.hasNextInt()/hasNextDouble() - Returns true if the Scanner s next token of input is a(n) int/double, returns false otherwise. fileScan.hasNextLine() - Returns true if the Scanner contains another line of input, returns false otherwise. fileScan.next() - Scans and returns the next token of input from this Scanner. fileScan.nextInt()/nextDouble() - Scans and returns the next token of input from this Scanner as a(n) int/double. fileScan.nextLine() - Scans and returns the next line of input from this Scanner. Lesson 14 - Winter 2023 5

More Related Content

giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#