Re-run the program with a different input

Assignment Help Business Management
Reference no: EM131687858

Use JGrasp to complete the following programs and understand what they do. Some of these programs are similar to those you completed in Lab #6.

Exercise 1: Java program (called Practice_7_1) that uses while loops to read an integer number between 20 and 60, then the program prints out the entered value followed by (on a separate line) the sum of all even integer values between 2 and the entered number (including the entered value if even). Use a while loop to validate the user input before determining and printing the sum. In addition, design your program such it allows the user to re-run the program with a different input. Use proper labels for the outputs as shown in the examples below.

Entered value: 20

Sum of even numbers between 2 and 20 is: 110

Entered value: 25

Sum of even numbers between 2 and 25 is: 156

Entered value: 30

Sum of even numbers between 2 and 30 is: 240

Entered value: 40

Sum of even numbers between 2 and 40 is: 420

Entered value: 60

Sum of even numbers between 2 and 60 is: 930

Exercise 2: Java program (called Practice_7_2) to read a sentence (as a string) from the user, the program then prints out the entered sentence. Then, print out the sentence one word per line using the space (blank) character as are delimiter. Use proper labels for the outputs as shown in the examples below. Design your program such it allows the user to re-run the program with a different input.

Entered String: This is a test input, and can be a longer string too.

Word #1: This

Word #2: is

Word #3: a

Word #4: test

Word #5: input,

Word #6: and

Word #7: can

Word #8: be

Word #9: a

Word #10: longer

Word #11: string

Word #12: too.

Reference no: EM131687858

Questions Cloud

Explain the evolution of electronic health records : Determine the issues impacting the electronic legal health records. Provide a rationale for your response.
Connection to wrap-around : What's the fewest number of hours it can take for a 50kb/s connection to wrap-around, i.e., to start reusing sequence numbers? Answer in hours to the nearest.
What are the two major type of compression : What are the two major type of compression, explain? Identify and explain which type is the best for compressing an encyclopedia.
Describe the managing the financial system : Describe the managing the financial system. How accurate are these predictions and how should a financial manager of a state agency apply them?
Re-run the program with a different input : Use JGrasp to complete the following programs and understand what they do. Some of these programs are similar to those you completed in Lab #6.
Compare different liabilities for selling education products : Ashley met Adam at a party and after a couple of drinks; Ashley found out that Adam is in the business of selling education products.
Approach advocated by richard stallman and others : Consider the "Free Software" approach advocated by Richard Stallman and others. Do you think this approach should be adopted?
General manager about some data storage problems : You're the IT administrator for CSM tech Publishing. You've just had a meeting with the general manager about some data storage problems
What marketing plan could be taken to minimize perception : What marketing challenges would ensue should a major health care provider drop a service that is socially popular but economically unprofitable?

Reviews

Write a Review

Business Management Questions & Answers

  Calculating financial advantage of dropping the product

Calculate the financial advantage or disadvantage of dropping the product given its current performance.

  Use mathematics to solve problems

How important is it to learn to use mathematics to solve problems

  Popular voting scheme

One popular voting scheme is rank-order voting, where individuals assign a rank (1, 2, 3) to the possible alternatives; the assigned ranks are then added up, and the alternative with the lowest sum win.

  Explain operational crm versus analytical crm

Explain operational CRM versus analytical CRM. Under what conditions would a decision maker use either application? Describe how technology has allowed for the development of enhanced features in e-commerce.

  Capital management practice analysis - automobile industry

Get a list of best practices for talent acquisition and the top five best human capital management practices within the automobile industry.

  What should happen to the us interest rate

Suppose a change in expectations regarding future U.S. inflation causes the expected future spot rate to decline to $1.52 : £1. What should happen to the U.S. interest rate?

  Discuss why productivity is important

Discuss why productivity is important, particularly in a healthcare organization. How do staffing models and labor optimization algorithms contribute towards productivity?

  How the three ethical theories we have been concentrating on

Consider how the three ethical theories we have been concentrating on - Utilitarianism, Kant's deontological ethical theory, and Virtue Ethics - would approach the question of power and wealth inequality.

  Differently when entering china

What should Google have done differently when entering China?

  How should you act in the given situations

In light of what you have learned in this chapter, how should you act in the following situations? Are the actions legal or illegal?

  Annual budget process for compensation

During the annual budget process for compensation, what are the most important items to consider during the budget process?

  Preferred location for the new warehouse

Transportation costs from location N1 to stores A, B, and C are $6, $8, and $7 per unit, respectively; from location N2, the costs are $10, $6, and $4, respectively. Which of the two locations is the preferred location for the new warehouse? Hint:..

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