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 program that takes three command-linearguments

Write a program that takes three command-linearguments number operator number and performs the required operation and prints the result on a single complete line in standard output.

  Create logic for program to count readers by genders

Create the logic for a program that would produce a count of readers by gender within age group - that is, under 20 females, under 20 males, etc.

  Formulate a linear programming model for given problem

A company produces two products that are processed on two assembly lines. Assembly line 1 has 100 available hours, and assembly 2 has 42 available hours. Formulate a linear programming model for this problem

  How you may be able to pass variables in your program

Describe in detail how you may be able to pass variables in your program and elaborate with code-specific syntax as to the required keywords for each of the different ways to pass variables in your program

  Write code for member method expand

Write code for the member method expand. To keep the code simple, you may assume that the array element has enough capacity and does not need to be resized.

  Construct a diagram using rationaleto map the arguments

Construct a diagram using Rationaleto map the arguments about a moral claim that you have identified in the article/case study

  Write a program that calculates a customer monthly bill

Write a program that calculates a customer's monthly bill. It should ask the user to enter the letter of the package the customer has purchased (A, B, or C) and the number of hours that were used. It should the display the total charges

  Deisgn child class that overrides parent method

Deisgn child class named Box, that contains additional data field named depth and a computeSurfaceArea() method that overrides the parent method appropriately for a three-dimensional box

  Estimate the storage space for telephone book

Estimate the storage space (number of bytes) required for each of the following items: A telephone book with 10,000 entries consisting of names, addresses and phone numbers. Use your phone book to estimate the average length of an entry.

  What are application programming interfaces apis recognize

what are application programming interfaces apis? identify several apis that could or do exist in the software

  Write a shell script to read from the keyboard

Write a shell script called poject. 21 to read from the keyboard and display on the monitor first name, last name and age if the age is less than 50. If the age is greater than 50, it will display your are over 5 instead of the age.

  Identify the various uses for http and https

Identify the various uses for HTTP and HTTPS

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