Sequence of integers

Assignment Help Macroeconomics
Reference no: EM131093773

Problem:

Jim would like to send a secret message to a friend using a sequence of words followed by a sequence of integers. Jim knows this secret message could be easily decoded, but it a first attempt to use cryptography for privacy purposes. The first integer is an index into the first word for one character. The 2nd integer is an index into the 2nd word for a 2nd character. This only works for a secret message that has exactly 5 characters. Write a Java program that hides a message using these two test cases with a dialog that looks like either one of these two dialogs:

Dialog 1

Enter five words: cheap energy can cause problems

Enter five integers: 4 2 1 0 5

Secret message: peace

  • Assume the index for each String is in range of 0 through the length() of the string - 1.
  • Send five next messages to the Scanner object to get five separate words, the first being:

String word1 = keyboard.next();

  • Send five nextInt() messages to the Scanner object to get five separate integers.

Reference no: EM131093773

Questions Cloud

An agronomist studied the effects of moisture : Refer to Crop yield Problem 11.25. The observations are listed in time order. Assume that regression model (12.2) with first- and second-order terms for the two predictor variables and no interaction term is appropriate.
Serviced within timing deadlines : Multimedia systems require _________ scheduling to ensure critical tasks will be serviced within timing deadlines.
National grocery retailer tracks productivity : Refer to Grocery retailer Problem 6.9. The observations are listed in time order. Assume that regression model (12.2) is appropriate. Test whether or not positive autocorrelation is present; use α = .05. State the alternatives, decision rule, and ..
Protection for that process : An ______ uniquely identifies processes and is used to provide address space protection for that process.
Sequence of integers : Jim would like to send a secret message to a friend using a sequence of words followed by a sequence of integers. Jim knows this secret message could be easily decoded, but it a first attempt to use cryptography for privacy purposes. The first int..
What is the consumer surplus in this market : A monopolist of a new computer software is facing demand: P = 100 -2 Q (where P is the unit price for this software and Q is its quantity) and MC = 20. What is the consumer surplus in this market
Explain how spirituality and faith in both works : Choose two religion-focused works from literature, theatre, music, or art (such as painting and sculpture) How do they call a religion into question?
The tri-city office equipment corporation sells : Refer to Copier maintenance Problem 1.20. The observations are listed in time order. Assume that regression model (12.1) is appropriate. Test whether or not positive autocorrelation is present: use α = .01. State the alternatives, decision rule, ..
What ways do you relate to diversity : Considering your increased understanding of diversity, in what ways, if any, would you want to modify any or all of the three professional goals which you articulated in the Reflection Assignment of Week1?

Reviews

Write a Review

Macroeconomics Questions & Answers

  Distinguish between the two output gaps in the economy

1. a) Distinguish between the two output gaps in the economy. b) Assuming the economy begins in long run equilibrium and policy makers take no action, use AD-SAS-LAS diagrams to show the short and long run effects on output and inflation of a shar..

  Determine what is the real interest rate

Suppose that the nominal rate of inflation is 4 percent and the inflation premium is 2 percent. 1.What is the real interest rate Alternatively, assume that the real interest rate is 1 percent and the nominal interest rate is 6 percent.

  Explain durable goods pricing

The monopoly sells two units of goods over two periods. The costs are zero. Consumer A has a valuation of 15 and Consumer B has a valuation of 10. Suppose the discount rate is ?=.8. If we allow Consumer B to have a valuation of k

  Explain the price elasticity of demand of widgets

Suppose the price of widgets falls from $7 to $5 and consumption of widgets rises from 15 widgets a month to 25 widgets.calculate the price elasticity of demand of widgets.

  How these variables can affect the demand for your product

Long-run cost curves are planning curves, while short-run cost curves are operating curves. Do you agree or disagree with this statement?

  Computing aggregate demand and aggregate supply

Suppose there are 10 consumers in the industry. Each has the following demand: p = 10 - q-Calculate aggregate demand and aggregate supply in the market.

  Buy a piece of pizza from the pizzeria

You become one of these when you buy a piece of pizza from the pizzeria or get a good from the store. Who is the person stated?

  Illustrate what are the impacts of an easy monetary policy

Illustrate what are the impacts of an easy monetary policy on the price-level and real output

  Employment and statuses based on the criteria used by the

based on the criteria used by the bureau of labor statistics bls identify each persons status as employed unemployed

  What is the present value of the payment to be received?

You expect to receive a payment of $104 one year from now. Your discount rate is 4 percent. What is the present value of the payment to be received. Suppose that the discount rate is 5 percent.

  Coke to ourconsumer what should we do if our goal

If it will cost us approximately $0.75/bottle to supply more Coke to our consumer what should we do if our goal is to maximize profit.

  You have been hired by a new firm selling electronic dog

you have been hired by a new firm selling electronic dog feeders. your client has asked you to gather some data on the

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