4th Street Bar Hive-Bar

Hive-Bar Powered by Hive beta-fdb5b5b

Community post

AP Computer Science - Methods and Loops Quiz

![APCSLogo.png](https://steemitimages.com/DQmXNmrb8ug59Z9Kck2Hq8wS9RJASeUFdrxruwWCNW8Fqri/APCSLogo.png)
Hello Everyone! It has been a month since I have posted, so today I am going to celebrate my 1000 followers by posting this and making a new logo and celebration post. Today's lesson for CS includes my most recent quiz and the solutions I typed out with the class. Any teachers that wish to use it may very well do so! Best wishes to all of you! I hope you enjoy! #### Number 1 What is the output of the following subcode: int x = 1; while (x < 50) { x *= 2 } System.out.print(x + “is the output.”); #### Number 2 How many times does the inner while loop execute? int j = 0, x = 0; while ( j++ < 100 ) { int k = 100; while ( k - - > 0 ) { x++; } } #### Number 3 Write a loop that simulates a countdown from 60 seconds down to zero. Your product should output: Countdown: 60… 59… 58… (and so on to)… Blast-off! #### Number 4 Write a main method that asks the user for the side length of a square, prints the perimeter, and prints the area. Use two helper methods that calculate perimeter and area. Do not do it in the main method. #### Number 5 Consider the following method and fill in the blank (//Your Code): public void arithmetic (int a1, int d, int an) { // Your Code } Implement a code that mimics the following examples: arithmetic (3,5,40) would print 3 8 13 18 23 28 33 38 arithmetic (-10, 7, 25) would print -10 -3 4 11 18 25 #### Solution 1 ![](https://steemitimages.com/DQmSNCSBKwHMhAQ9HFB9X1nyiqnCPMacbkyZohvTg2icV66/image.png) #### Solution 2 ![](https://steemitimages.com/DQmbrUUG6nH9gcZHZMGRWHjye2AhipBYSJfMiuswpnsL6fZ/image.png) #### Solution 3 ![](https://steemitimages.com/DQmTMyFsXgMpWH8VQdZB5MJcxDcyGp3dkahuZEJjtaXLiq5/image.png) #### Solution 4 ![](https://steemitimages.com/DQma3fWaQRqGe9Zi1FqdzTTnWpVgRXYW7bwADdGXbaEdkVv/image.png) #### Solution 5 ![](https://steemitimages.com/DQmPFoV5FLXdsrNsc1MiUKzsViKzdyv1iz45Fkb4g6fN7bC/image.png)
![BAR.png](https://steemitimages.com/DQmV1TfqJ7SzYtEtt6pxAAzFGDxT7qr96nBunRh8V5wiMPv/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, Kinematics and Forces Quiz, Forces in 1-Dimension, Forces in 2-Dimensions, Basic Physics, Kinematics, and Forces Review, AP Physics Midterm Exam, AP Physics Midterm Exam Solutions , Kinematics and Forces Quiz, Another Kinematics and Energy Quiz, Momentum Lesson ###### Computer Science 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18 ###### SAT Asymptotes, Composite Functions, Contest 1 - Area, Contest 1 – Winners and Solution, PEMDAS, Systems of Equations, Functions, Exponents, Contest 2 - More Functions, Contest 2 – Winners and Solution, Percents, The Interest Equation, All About Division, Contest 3 - Factoring, Contest 3 – Winners and Solution, Fractional and Negative Exponents, Basic Trig, Contest 4 - Math Vocab, Contest - 5, Contest 5 – Winners and Solution, Contest 6, Contest 6 – Winners and Solution ###### 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](https://steemitimages.com/DQmV1TfqJ7SzYtEtt6pxAAzFGDxT7qr96nBunRh8V5wiMPv/BAR.png)
Thank you for your views Steemers! The support is much appreciated! Learn much and best wishes!
![STMEdu.gif](https://steemitimages.com/DQmVM1RNSZQpF6FNR3FM19o1uxAsSPYQCM4rpKpVvHpAc7L/STMEdu.gif)
![ColorGIF.gif](https://steemitimages.com/DQmTyTkDUuEEZb2B2N6GmesbscKQdakvbdYMAnWdTLfcusg/ColorGIF.gif)
12 upvotes $0.06

Replies (5)

Review before signing

Posting as . Signing with . Keychain permission: Posting. Hive Keychain will ask you to approve this action next.


  
Technical details

Operation fingerprint: