Giter Club home page Giter Club logo

exercises-for-programmers-go's Introduction

Exercises for Programmers, in Golang

Last time it was Ruby. This time, Go is what I will be using.

Book

Exercises for Programmers on PragProg.com

Exercises

  1. Saying Hello: Create a program that prompts for your name and prints a greeting using your name.

  2. Character Counter: Create a program that prompts for an input string and displays output that shows the input string and the number of characters the string contains.

  3. Printing Quotes: Create a program that prompts for a quote and an author. Example: Obi Wan said, "These are not the droids you are looking for"

  4. Mad Libs: Create a simple mad-lib program that prompts for a noun, a verb, an adverb, and an adjective and injects those into a story that you create. Accept a noun, verb, adjective, and adverb.

  5. Simple Math: Write a program that prompts for two numbers. Print the sum, difference, product, and quotient of those numbers as shown in the example output.

  6. Retirement Calculator: Create a program that determines how many years you have left until retirement and the year you can retire. It should prompt for your current age and the age you want to retire and display the calculation.

  7. Rectangular Room: Create a program that calculates the area of a room. Prompt the user for the length and width of the room in feet. Then display the area in both square feet and square meters, using the following equation:

    m**m = f**f * 0.09290304
    
  8. Pizza Party: Write a program to evenly divide pizzas. Prompt for the number of people, the number of pizzas, and the number of slices per pizza. Ensure that the number of pieces comes out even. Display the number of pieces of pizza each person should get. If there are leftovers, show the number of leftover pieces.

  9. Paint Calculator: Calculate gallons of paint needed to paint the ceiling of a room. Prompt for the length and width, and assume one gallon covers 350 square feet. Display the number of gallons needed to paint the ceiling as a whole number.

  10. Self-Checkout: Create a simple self-checkout system. Prompt for the prices and quantities of three items. Calculate the subtotal of the items. Then calculate the tax using a tax rate of 5.5%. Print out the line items with the quantity and total, and then print out the subtotal, tax amount, and total.

  11. Currency Conversion: Write a program that converts currency. Specifically, convert euros to U.S. dollars. Prompt for the amount of money in euros you have, and prompt for the current exchange rate of the euro. Print out the new amount in U.S. dollars. The formula for currency conversion is amount_to = (amount_from * rate_from) / rate_to, where rate_to is generally 1.0. More details can be found on Mathinary's Currency Conversion page.

  12. Computing Simple Interest: Create a program that computes simple interest. Prompt for the principal amount, the rate as a percentage, and the time, and display the amount accrued (principal + interest). The formula for simple interest is A = P * (1 + rt), where P is the principal amount, r is the annual rate of interest, t is the number of years the amount is invested, and A is the amount at the end of the investment. Example: $1758 = 1500(1 + (0.043 ร— 4)) More details can be found at Simple Interest Calculator.

  13. Computing Compound Interest: Skipped

exercises-for-programmers-go's People

Stargazers

 avatar

Watchers

 avatar  avatar

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.