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

  What is the inflation rate as measured by the gdp deflator

Consider an economy that produces only chocolate bars. In year 1, the quantity produced is 3 bars and the price is $4. In year 2, the quantity produced is 4 bars and the price is $5. In year 3, the quantity produced is 5 bars and the price is $6. ..

  Determine the reaction function for each firm

The inverse market demand in a homogeneous-product Cournot duopoly is p=200-3(Q1+Q2) and costs are C1(Q1)=26Q1 and C2(Q2)=32Q2. Determine th reaction function for each firm. FIrm 1 Q1=, Firm2 Q2= Calculate each firm's equailibrium output.

  Give specific examples of how the determinants of demand

Think about a product that you have purchased recently (e.g. soda, diapers, takeout meals, milk, shoes, manicure/pedicure, video game, etc.).

  What is the economic interpretation of the result

(a) Set up the basic arbitrage equation that will ultimately pin down the value of the patent. On the left side show the return from investing pi dollars in a saving account. On the right, show the return from using these funds to purchase the pat..

  What about transfer payments made by the gov to the poor

If the gov spends $10 million giving subsidies to certain types of companies, is that money added to the category of G. What about if the gov gives a grant to a company. What about transfer payments made by the gov to the poor.

  Explanation of import tariff and export quota

Write a brief explanation of each of the following terms. import tariff, effective rate of protection

  Africa business environment

Explain why the authors cite ethnically segmented markets as a factor that holds back private sector development and building entrepreneurial capacity.

  Elucidate how these economic concepts can be used

Elucidate how these economic concepts can be used to address IBM's problems and opportunities. Identify which economic and political policies affect your IBM and explain how they impact business decisions.

  What type of unemployment is omar facing

Due to the current slump in investment spending, Omar has been laid off from his programming job. His employer promises to rehire him when business picks up. What type of unemployment is Omar facing?

  Discuss market trends that your selected organization

Discuss market trends that your selected organization/industry will face. My organization is Ford.

  Question detailidentify two countries of your choice one

question detailidentify two countries of your choice one that has recently experienced relatively strong and robust

  What effect does this have on the current exchange rate

Suppose the market for dollars is in equilibrium, then the expected future exchange rate rises. What effect does this have on the current exchange rate?

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