Write a program that reads an initial investment balance

Assignment Help Programming Languages
Reference no: EM131142573

R7.1 Carry out the following tasks with an array:

a. Allocate an array a of ten integers.
b. Put the number 17 as the initial element of the array.
c. Put the number 29 as the last element of the array.
d. Fill the remaining elements with -1.
e. Add 1 to each element of the array.
f. Print all elements of the array, one per line.
g. Print all elements of the array in a single line, separated by commas.

R7.2 What is an index of an array? What are the legal index values? What is a bounds error?

R7.4 Write a loop that reads ten numbers and a second loop that displays them in the opposite order from which they were entered.

P7.1 A run is a sequence of adjacent repeated values. Write a program that generates a sequence of 20 random die tosses in an array and that prints the die values, marking the runs by including them in parentheses, like this:

12 (5 5) 3 1 2 4 3 (2 2 2 2) 36 (5 5) 631

Use the following pseudocode:

Set a boolean variable inRun to false.
for each valid index i in the array
If inRun
If values[i] is different from the preceding value
Print ).
inRun = false.
If not inRun
If values[i] is the same as the following value
Print
inRun = true.
Print values[i].
If inRun, print ).

1. For a given number, print a pyramid of that many levels. We've covered how to print out half of the pyramid similar to the following:
*
**
***
****
*****

Now we want to print (notice the spacing)

     **
   ****
  ******
 ********
**********

2. Write a program that lists the first 400 multiples of 13. List that number, followed by whether it is even or odd.

3. Write a program that adds a letter to a string until the user wants to quit.

4. Write a program that reads an initial investment balance and an interest rate. Then print the number of years it takes for the investment to reach one million dollars.

Reference no: EM131142573

Questions Cloud

Determine the grade of the road : Assuming standard perception/reaction time and practical stopping distance, determine the grade of the road.
Why do you suppose 131 53 i is used for this treatment : The radiation emitted by the source can destroy cancerous cells. Why do you suppose 131 53 I is used for this treatment?
Determine the drivers perception : Determine the drivers perception/reaction time before and after drinking - the driver fails to stop in time and strikes the object at a speed of 30 mi/h.
Which has the greatest penetration into tissue : Of the three basic types of radioaction-alpha, beta, and gamma-which has the greatest penetration into tissue? Explain the rationale behind your answer.
Write a program that reads an initial investment balance : Write a program that reads an initial investment balance and an interest rate. Then print the number of years it takes for the investment to reach one million dollars.
Find the decay constant and half-life of the isotope : A freshly prepared sample of a certain radioactive isotope has an activity of 10 mCi. After 4 h, the activity is 8 mCi.
What is the maximum acceleration from rest : What is the maximum acceleration from rest of this car on this test track?
Discuss how some tax systems place a double tax on saving : 1. Discuss the way that saving is taxed under an income tax and a consumption tax. Which is more efficient? Why? Which is more equitable? Why? In your explanation, be sure to discuss how some tax systems place a double tax on saving.
Which treatments are proving to be successful and why : What are the primary challenges of sex offender treatment programs? Which treatments are proving to be successful and why

Reviews

Write a Review

Programming Languages Questions & Answers

  Write a haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

These 14 questions covers java class, Array, link list , generic class.

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

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