AP Computer Science - Random and String Formatting (10)

in #tutorials7 years ago

APCSLogo.png

Lesson

Go Over Homework

Students were asked to write a program that converted base 8 numbers to base 10.
Capture.PNG

Output:

Capture3.PNG

Introduce Math.random()

Chose a random class member.

Capture2.PNG

Formatting Strings


Source: https://docs.oracle.com/javase/tutorial/java/data/numberformat.html

Practice:

Write a code that asks the user "Circle or Square?". Once answered, a random radius or side length is given (up to 100), then prints the radius, circumference/perimeter, and area.
Capture6.PNG

Output:

Capture12.PNG

BAR.png

All SteemitEducation Posts

Physics

Kinematics Video, Circular Motion Video, Forces in 1 & 2 Dimensions Videos, Kinematics Full Lesson, Circular Motion and Gravitation Full Lesson

Computer Science

1, 2, 3, 4, 5, 6, 7, 8, 9

SAT

Asymptotes, Composite Functions, Contest 1 – Winners and Solution, PEMDAS, Systems of Equations, Functions, Exponents, Contest 2 – Winners and Solution, Percents, The Interest Equation, All About Division, Contest 3 – Winners and Solution, Fractional and Negative Exponents, Basic Trig, Contest 4 - Math Vocab

General Math

Basics of Algebra, Trigonometry Video, Proof of Quadratic Formula, Factoring Video, Unions and Intersections, Surface Area of a Cylinder, Substitution Video, Combinatorics Basics

Graphing from Algebra to Calculus

Algebra 1, Algebra 2, Pre-Calculus, Calculus

Piloting Airplanes

Introduction, Preflight, Requirements, Instruments, Take-Offs and Landings, Why a Plane Can Fly, Reading the Runway, Maneuvers

Other

Engineering (Isometric) Drawing, Pressure & SCUBA Diving

BAR.png

Thank you for viewing Steemians! The support is much appreciated! Learn much and best wishes!

STMEdu.gif

CloudLogo.gif

Sort:  

Nice one 👍
A besic knowledge of mathematics is required

Yes. Definitely a different subject. Can be very difficult at times. Haha

This post has received a 100% upvote worth $0.07 from @minnowspower thanks to: @theguruasia

MinnowsPower is not a bot, I am a Crowdfunding Hybrid
One small UpVote of Yours build MinnowsPower and MinnowsPower will Not Forget Your Support...!!!
(Limited Service Offer) Send 0.01 SBD and get $0.025 - $0.03 worth upvote from @MinnowsPower

Nice post. Sufficient basic knowledge :)

Yes. Quite basic. Fun to program though!

Coin Marketplace

STEEM 0.16
TRX 0.13
JST 0.027
BTC 58539.27
ETH 2627.11
USDT 1.00
SBD 2.40