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

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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