Coder Social home page Coder Social logo

Topic: for-each-loop Goto Github

Some thing interesting about for-each-loop

Related Topics:

👇 Here are 6 public repositories matching this topic...

  • bell-kevin / chapter12exerciseprojectcountingcoins

    for-each-loop,Chapter 12 Exercise Project: Counting Coins. You run a very successful ice cream truck in the summer, with lots of kids paying for ice cream in coins. At the end of the day, you have a large pile of coins. It would be very helpful if you could just count the number of quarters, the number of dimes, the number of nickels, and the number of pennies, enter those counts of each type of coin into a program, and have the program calculate the total worth of all the coins. For this project, you will use an enum named Coin, which specifies the name and the worth of each type of coin. See Fig 12.11a on p. 547 for an example of an enum with additional information. In the driver code, ask the user how many coins are a quarter, how many are a dime, and so on, and calculate the value of that pile of coins. Ask the user what they think the pile of coins is worth. Using the ternary or conditional operator, compare the user's guess to the value of the pile of coins to display either "You are correct" or "You are incorrect". Note that the names of each member of the enum are capitalized, as appropriate for constants. Use a For-Each loop to go through each of the elements of the enum to ask for the number of that type of coin and calculate the worth of those coins. Look at the code on the bottom of p. 548 for an example. Be sure to use proper formatting for currency on those lines displaying money values. Run the project 4 times, with different values for the piles of coins. Two of the guesses need to be correct and 2 incorrect. Take screenshots of the results. Note: This project must have an enum, a For-Each loop, and a ternary or conditional operator. Submission:the specified screenshots and the root folder for the project Pay careful attention to the rubric for this assignment. Note that you must use correct formatting in the code -- appropriate indentation is most important. You can use Shift-Alt-F to have NetBeans automatically format the code correctly. If the formatting is incorrect, it will be returned to you for changes with a grade of zero. Note: You need to submit the whole project for these assignments. In File Explorer, go to the location where you created the project. There will be a folder with the name of your project -- that is the root folder of the project. If you submit the root folder of the project, the instructor can run it on a different machine to grade it. If you don't submit the proper folder, it won't run on another machine, and the assignment will be marked with a zero.

    User: bell-kevin

    enum enumerated-types enumeration for-each ternary-operator for-each-loop
  • suyogghate / connect-4-game

    for-each-loop,This is a connect-4 game played between 2 players in which one player is assigned yellow color and other gets red color. Then player's turn is showed in the top right corner. The aim of the player is to make 4 of his color in upward/downward/diagonal direction. The first player who manages to get this wins.

    User: suyogghate

    Home Page: https://connect-4-fb26f8.netlify.app/

    html-css-javascript map array-methods async-await dom-manipulation for-each-loop for-of-loop spread-operator ternary-operator

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.