Write a program to list the number of grains of wheat

Assignment Help Computer Engineering
Reference no: EM132192690

Program : King's Reward 

A grateful king told the man who saved the kingdom to choose any reward he wanted. The man asked that he be given one grain of wheat for the first square on a chessboard, 2 grains of wheat the second square, 4 grains for the third square, and so on, doubling each time. The king, who was not a mathematician, agreed.

There are 64 squares on a chessboard. Write a program to list, for each square, the number of grains of wheat on that square Do the program in 2 ways: (1) Use an integer variable for the number of grains (2) Use a double variable for the number of grains.

Then observe your output (which is to be in a file) to find out whether your results are accurate. If they are not accurate, which square is the first bad one (doesn't have the correct number of grains on it Put your observations in a comment in the program source file. Turn in the source file and the output file.

Reference no: EM132192690

Questions Cloud

Identify features that could be implemented : The goal of the group is to identify features that could be implemented into the next few releases of your firm's software.
Knowing locations of users in real time : What types of new applications can emerge from knowing locations of users in real time? What if you also knew what they have in their shopping cart, for example
What is the reasoning behind the given view : It is often said that developing countries have little to gain from economic integration projects among themselves because they trade very little.
What is the expected price of the material per pound : What is the expected price of the material per pound? What is the expected amount of material needed for 100 units?
Write a program to list the number of grains of wheat : Write a program to list, for each square, the number of grains of wheat on that square Do the program in 2 ways.
Average time to read a single sector : Suppose we have a magnetic disk with the following parameters: What is the average time to read a single sector?
At what real interest rate will investment just break even : If an additional unit of capital is invested, it will yield a marginal product equal to 0.06, the mark-up is 20 percent and the depreciation rate is 3 percent.
Popularity ranking techniques such as pagerank : What is the effect of such rings on popularity ranking techniques such as PageRank?
Review problem on endogenous variables : Endogenous variables are explained within the model while exogenous variables are taken as given. The dependency of investment on the growth of demand.

Reviews

Write a Review

Computer Engineering Questions & Answers

  What are some of the pros and cons of open source software

What are some of the pros and cons of using open source software. Do you currently use any. What would be your biggest concerns about

  Generate the hash values using the perfect hash algorithm

Research perfect hash functions. Using a list of names (classmates, family members, etc.), generate the hash values using the perfect hash algorithm.

  Questionmicrosoft windows server 2008 network

questionmicrosoft windows server 2008 network infrastructure configuration case studyyou work for a company that has

  Questionwireless technologywrite down a three to four page

questionwireless technologywrite down a three to four page paper in which you-1. compare pros and cons of 3g and 4g

  Write down a new program in pseudocode

display what the PC monitor will display when this program is executed with the following values used: 86, 55, and 100.

  Define the project schedule when outsourcing critical tasks

Suggest at least three (3) potential challenges of controlling the project schedule when outsourcing critical tasks

  Write your own class called weatherstats to manage

Write your own class called WeatherStats to manage the ordered collection of high temperatures.

  Develop a casual iOS game - BubblePop Game

Programming Project Assignment: BubblePop Game. A client has just hired you to develop a casual iOS game based on an idea he had recently

  How a process might move through the various process states

Describe how a process might move through the various process states. Create specific reasons why this process moves from one state to another.

  How can a customer protect against that single point of fail

How can a customer protect against that single point of failure? Provide an analysis on whether this presents a good cost-benefit trade-off.

  What is an interrupt address vector

Discuss the basic difference between polled I/O and interrupt I/O. What is the difference between subroutine and interrupt I/O?

  Express how the required task can be achieved

The parameter element is a data item to be added to the array. The parameter position is the array index at which the new element will be inserted. be sure to account for elements that must be moved over to make room for the new element.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd