gram
s.
Below is a snippet of code that we will be entering in:
public class HelloWorld
{
public static void main(String[] args)
{
System.out.println("Hello World!");
}
}
Programming is about solving problems. The entire purpose of writing a program is to solve a problem which, in general, consists of multiple steps:
- Understanding the problem.
- Breaking the problem into manageable pieces.
- Designing a solution.
- Considering alternatives to the solution and refining the solution.
- Implementing the solution.
- Testing the solution and fixing any problems.
Below are some potential "problems" for you to solve using flow charts.
Flow Chart Practice:
- A movie theater wants a program that will show admission price based on age. They want to charge children (under 12) and seniors (65 and older) $5.25. Everybody else will pay $9.25. They want to ask "How old are you?", let the person put in their age (in years), tell them the price, then tell them to "Enjoy the show!".
- A daycare provider wants to give gumballs to their kids, but they want a program that will ask the worker, "How many gumballs?" and then "How many kids?". Then it should divide the gumballs per kid (gumballs/kids). Finally it should say, "Each kid gets X gumballs."
- You decide to write an app for a SmartPhone. You want to do a Magic 8 Ball app where you ask a question and it gives you a "Yes" or "No" answer.
- You want to write a program that will pick a random number between 1 and 1000. Ask the player to guess a number and tell them if they are too high, too low, or if they get the number correct. The program should keep running until they guess the number correctly.
No comments:
Post a Comment