• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 12:49
CEST 18:49
KST 01:49
  • Home
  • Forum
  • Calendar
  • Streams
  • Liquipedia
  • Features
  • Store
  • EPT
  • TL+
  • StarCraft 2
  • Brood War
  • Smash
  • Heroes
  • Counter-Strike
  • Overwatch
  • Liquibet
  • Fantasy StarCraft
  • TLPD
  • StarCraft 2
  • Brood War
  • Blogs
Forum Sidebar
Events/Features
News
Featured News
TL.net Map Contest #21: Voting4[ASL20] Ro4 Preview: Descent11Team TLMC #5: Winners Announced!3[ASL20] Ro8 Preview Pt2: Holding On9Maestros of the Game: Live Finals Preview (RO4)5
Community News
Weekly Cups (Oct 6-12): Four star herO65.0.15 Patch Balance Hotfix (2025-10-8)72Weekly Cups (Sept 29-Oct 5): MaxPax triples up3PartinG joins SteamerZone, returns to SC2 competition325.0.15 Balance Patch Notes (Live version)119
StarCraft 2
General
The New Patch Killed Mech! TL.net Map Contest #21: Voting 5.0.15 Patch Balance Hotfix (2025-10-8) Ladder Impersonation (only maybe) Weekly Cups (Oct 6-12): Four star herO
Tourneys
LiuLi Cup - September 2025 Tournaments Sparkling Tuna Cup - Weekly Open Tournament Master Swan Open (Global Bronze-Master 2) Tenacious Turtle Tussle WardiTV Mondays
Strategy
Custom Maps
External Content
Mutation # 495 Rest In Peace Mutation # 494 Unstable Environment Mutation # 493 Quick Killers Mutation # 492 Get Out More
Brood War
General
Pros React To: BarrackS + FlaSh Coaching vs SnOw BW caster Sayle ASL20 General Discussion [ASL20] Ro4 Preview: Descent BW General Discussion
Tourneys
[Megathread] Daily Proleagues [ASL20] Semifinal B [ASL20] Semifinal A [ASL20] Ro8 Day 4
Strategy
Current Meta BW - ajfirecracker Strategy & Training Siegecraft - a new perspective TvZ Theorycraft - Improving on State of the Art
Other Games
General Games
Stormgate/Frost Giant Megathread Nintendo Switch Thread ZeroSpace Megathread Dawn of War IV Path of Exile
Dota 2
Official 'what is Dota anymore' discussion LiquidDota to reintegrate into TL.net
League of Legends
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Deck construction bug Heroes of StarCraft mini-set
TL Mafia
SPIRED by.ASL Mafia {211640} TL Mafia Community Thread
Community
General
US Politics Mega-thread Things Aren’t Peaceful in Palestine Russo-Ukrainian War Thread Men's Fashion Thread Sex and weight loss
Fan Clubs
The herO Fan Club! The Happy Fan Club!
Media & Entertainment
Anime Discussion Thread [Manga] One Piece Movie Discussion!
Sports
2024 - 2026 Football Thread Formula 1 Discussion MLB/Baseball 2023 NBA General Discussion TeamLiquid Health and Fitness Initiative For 2023
World Cup 2022
Tech Support
SC2 Client Relocalization [Change SC2 Language] Linksys AE2500 USB WIFI keeps disconnecting Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List Recent Gifted Posts
Blogs
Inbreeding: Why Do We Do It…
Peanutsc
From Tilt to Ragequit:The Ps…
TrAiDoS
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1081 users

procrastinating

Blogs > RtS)Night[Mare
Post a Reply
Night[Mare
Profile Blog Joined December 2004
Mexico4793 Posts
Last Edited: 2008-02-21 04:21:25
February 20 2008 04:35 GMT
#1
i have to deliver my first java exam in 14 hours, and i havent started yet. I find the problems rather easy
+ Show Spoiler +

Problems
1. Write a program that will evaluate simple expressions such as 17 + 3 and 3.14159 * 4.7. The expressions are to be typed in by the user. The input always consist of a number, followed by an operator, followed by another number. The operators that are allowed are +, -, *, and /. Your program should read an expression, print its value, read another expression, print its value, and so on. The program should end when the user enters 0 as the first number on the line.

2. Write a program that reads one line of input text and breaks it up into words. The words should be output one per line. A word is defined to be a sequence of letters. Also, to "capitalize" a string means to change the first letter of each word in the string to upper case (if it is not already upper case). For example, a capitalized version of "Now is the time to act!" is "Now Is The Time To Act!".For example, if the user inputs the line
He said, "That's not a good idea."
then the output of the program should be
He
Said
That’s
Not
A
Good
Idea
An improved version of the program would list "that's" as a single word. An apostrophe can be considered to be part of a word if there is a letter on each side of the apostrophe.
To test whether a character is a letter, you might use (ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z'). However, this only works in English and similar languages. A better choice is to call the standard function Character.isLetter(ch), which returns a boolean value of true if ch is a letter and false if it is not. This works for any Unicode character.

Note that a letter is the first letter of a word if it is not immediately preceded in the string by another letter. Recall that there is a standard boolean-valued function Character.isLetter(char) that can be used to test whether its parameter is a letter. There is another standard char-valued function, Character.toUpperCase(char), that returns a capitalized version of the single character passed to it as a parameter. That is, if the parameter is a letter, it returns the upper-case version. If the parameter is not a letter, it just returns a copy of the parameter.

3. Suppose you choose people at random and check their birthdays. How many people will you check before you find one who has the same birthday as someone you've already checked? The days of the year are numbered from 0 to 364.


but the problem is that i know next to nothing in java syntax. I would easily do them in C++ >.<, if anyone here knows java feel free to help me out

zombie story part 5 due to thursday i think, i need to study for computer organization( much like logic circuits)

[image loading]


**
Teamliquidian townie
fight_or_flight
Profile Blog Joined June 2007
United States3988 Posts
February 20 2008 05:40 GMT
#2
I don't know what to say other than look at a lot of example problems and their java solutions...maybe that will help you learn the syntax.
Do you really want chat rooms?
Night[Mare
Profile Blog Joined December 2004
Mexico4793 Posts
February 20 2008 19:48 GMT
#3
ah, good enough for me, i finished my examn just in time, and all the programs were fine and running
Teamliquidian townie
ATeddyBear
Profile Blog Joined December 2005
Canada2843 Posts
February 20 2008 22:40 GMT
#4
dude wtf no girl
Professional twice over - an analyst and a therapist. The world’s first analrapist.
Steelflight-Rx
Profile Blog Joined July 2007
United States1389 Posts
Last Edited: 2008-02-20 22:54:33
February 20 2008 22:51 GMT
#5
You would use a scanner class to do the 2nd one, altho i have never used it myself, it is able to read and output data from a designated source file. (maybe you already knew that, idk, but if not that should give u a step in the right direction).

As for syntax, i dont know any C++ so i wouldn't be able to tell u how they are different/the same/whatever

edit: No zombie update! =O, i have been waiting for the next part since last night -.-
yubee wrote: you know? it's a great night you should all smile no matter what harddships, because grass grows and the sky is blue and it's a good life.
Scorpion
Profile Blog Joined April 2006
United States1974 Posts
February 20 2008 23:52 GMT
#6
Procrastinators unite!

Tomorrow...
Mango @ U.S.East!
Night[Mare
Profile Blog Joined December 2004
Mexico4793 Posts
February 21 2008 04:22 GMT
#7
imma lose my reputation if i dont keep posting girls at the end of my blogs.

Zombie update for friday people!
Teamliquidian townie
Please log in or register to reply.
Live Events Refresh
Next event in 6h 12m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
SpeCial 442
TKL 142
ProTech73
BRAT_OK 24
MindelVK 9
StarCraft: Brood War
Calm 4660
Rain 2787
Flash 2387
ZerO 541
Soma 526
Stork 437
Mini 408
Snow 301
Leta 301
Zeus 191
[ Show more ]
Hyun 161
hero 151
Mong 108
Rush 82
Larva 74
Light 59
Barracks 57
JYJ51
Sharp 50
Killer 49
Backho 44
Mind 43
Rock 29
Aegong 18
Sacsri 18
scan(afreeca) 17
Movie 15
Noble 11
Shine 10
Terrorterran 4
Dewaltoss 1
Dota 2
Gorgc9101
qojqva2726
Dendi1103
420jenkins343
Counter-Strike
fl0m378
allub72
Other Games
singsing2056
FrodaN1128
Beastyqt644
ceh9502
Skadoodle419
Hui .402
KnowMe118
markeloff118
ArmadaUGS100
QueenE68
Mew2King43
rGuardiaN42
Trikslyr36
ZerO(Twitch)17
Organizations
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 16 non-featured ]
StarCraft 2
• poizon28 29
• Adnapsc2 12
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• HerbMon 20
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• C_a_k_e 2628
League of Legends
• Nemesis4461
Other Games
• Shiphtur292
Upcoming Events
OSC
6h 12m
Replay Cast
6h 12m
The PondCast
17h 12m
OSC
19h 12m
Wardi Open
1d 18h
CranKy Ducklings
2 days
Safe House 2
3 days
Sparkling Tuna Cup
3 days
Safe House 2
4 days
Liquipedia Results

Completed

Acropolis #4 - TS2
WardiTV TLMC #15
HCC Europe

Ongoing

BSL 21 Points
ASL Season 20
CSL 2025 AUTUMN (S18)
C-Race Season 1
IPSL Winter 2025-26
EC S1
Thunderpick World Champ.
CS Asia Championships 2025
ESL Pro League S22
StarSeries Fall 2025
FISSURE Playground #2
BLAST Open Fall 2025
BLAST Open Fall Qual
Esports World Cup 2025
BLAST Bounty Fall 2025
BLAST Bounty Fall Qual
IEM Cologne 2025

Upcoming

SC4ALL: Brood War
BSL Season 21
BSL 21 Team A
RSL Offline Finals
RSL Revival: Season 3
Stellar Fest
SC4ALL: StarCraft II
eXTREMESLAND 2025
ESL Impact League Season 8
SL Budapest Major 2025
BLAST Rivals Fall 2025
IEM Chengdu 2025
PGL Masters Bucharest 2025
TLPD

1. ByuN
2. TY
3. Dark
4. Solar
5. Stats
6. Nerchio
7. sOs
8. soO
9. INnoVation
10. Elazer
1. Rain
2. Flash
3. EffOrt
4. Last
5. Bisu
6. Soulkey
7. Mini
8. Sharp
Sidebar Settings...

Advertising | Privacy Policy | Terms Of Use | Contact Us

Original banner artwork: Jim Warren
The contents of this webpage are copyright © 2025 TLnet. All Rights Reserved.