write a simple c++ program that calculates the amount of money earned on an investment, based on an 8% annual return. Prompt the user to enter an investment amount and the number of years for the investment. display an error message if the user enters 0 for either value; otherwise, display the total amount (balance) for each year of the investment

Question

write a simple c++ program that calculates the amount of money earned on an investment, based on an 8% annual return. Prompt the user to enter an investment amount and the number of years for the investment. display an error message if the user enters 0 for either value; otherwise, display the total amount (balance) for each year of the investment.

Expert Answer

Want to see the step-by-step answer?

Check out a sample Q&A here.

Want to see this answer and more?

Experts are waiting 24/7 to provide step-by-step solutions in as fast as 30 minutes!*

*Response times may vary by subject and question complexity. Median response time is 34 minutes for paid subscribers and may be longer for promotional offers.
Tagged in
Engineering
Computer Engineering

Programing

Related Computer Engineering Q&A

Find answers to questions asked by students like you.

Q: Allocate the memory at runtime to store 10 integer numbers and ask values from the user. Now, create...

A: A number is said to be prime if it has only two factors 1 and itself If number is prime prime, P is ...

Q: Example: Defining Classes and Creating Object (Cont'd)

A: public class Main{ public static void main(String[] args) {    TV tv=new TV();     //create an objec...

Q: 4) In the level control system of a process, it has used two input - one output fuzzy logic controle...

A: a)The rule bases are in the form of IF Then rules: The rules can be in the form, IF A is less than  ...

Q: 1. Evaluate the Information Systems Development Life Cycle (ISDLC) as anapproach to the development ...

A: 1. There are seven phases in ISDLC which is used in development of IS. Preliminary Analysis : In th...

Q: In a class of N students where girls and boys ratio is p:q Savita ranked rth from the top. If there ...

A: Click to see the answer

Q: Discuss various ways of initialising 1D and 2D arrays in C. Also discuss their memory representation...

A: An array of arrays is known as 2D array. The two dimensional (2D) array in C programming is also kno...

Q: Give the properties of “trustworthy”encryption system.

A: Encryption is basically a way by which the confidential information is converted into a secret code ...

Q: The copywriter in the Marketing Department uses a Windows 10 computer that has some problems. Each t...

A: The following steps will be used for fixing the files in the D: drive- Left-click on the Start menu...

Q: Create a class named FootballTeam. Include two fields that hold data about theteams participating in...

A: Note: Three classes has been created for the given criteria. File name: "FootballTeam.java" public c...

Q: List and describe four sources of vulnerability intelligence. Which seems the most effective? Why?

A: Vulnerability intelligence sources: List of vulnerability intelligence sources are discussed as fol...

Q: Write a program to input two integers from user by using single scanf. Compute and display the value...

A: A single scanf can take more than one value and to make it happen you need to specify addresses of a...

Q: In Python, use only some or all of the following concepts: decision structures, repetition structure...

A: Python code: def grade_average(marks_lst):       #function to find average of all the marks     s =...

Q: data of 700 kbps is to be transmitted over a channel of 5 kHz bandwidth and 200 kbps capacity. The t...

A: Bandwidth B = 5 kHz Data Rate, C = 700 kbps  

Q: write step - by - step command  CREATE BELOW TABLE CREATE TABLE empl (month INT, emp VARCHAR (15), d...

A: The table is created using the query CREATE TABLE empl (month INT, emp VARCHAR (15), dept VARCHAR (1...

Q: When it comes to routing, we can either configured distant routes statically or dynamically.  When i...

A: Static routing-  It is also known as non-adaptive routing. It doesn’t change the routing table unle...

Q: give solution in C++ LANGUAGE AND SECREEN SHOT OF EACH SOURCE CODE

A: Please find the answer below :

Q: 2. Write a program to implement linear search for char data in 1D array. Use pointer to array for th...

A: Linear search is a process of searching the index of an element Starting from 0th index of array we ...

Q: Given a non-dummy headed circular list, write down a method for inserting an elementinto the list.

A: In a circular linked list, the last node contains a pointer which points to the first node of the li...

Q: GIVE SOLUTION IN C++ LANGAUGE AND JUST USE CONSTANT CONCEPT OR OPERATOR

A: The program is written in C++

Q: If CS=2000H, DS=35A0H, SS=3210H, ES=5890H, BX=42A9H, BP=3400H, find the physical adress of the sourc...

A: Actually, CS =code segment SS= stack segment BX= base register BP= base pointer ES= extra segment DS...

Q: 31. For the MyMy1 queueing model, why do the followingresults hold? (Hint: Remember that 1ym is the ...

A: a) Here Adding 1 on both sides, So finally it will be:

Q: Write a python program to take a list input of 10 elements and find the elements that is nearest to ...

A: A number is said to be nearest if the difference between them is minimum

Q: Write a program which should consists of a user defined function “fun ()” [Function returns no value...

A: Store the index where the element is found If index is same as initial index which means element not...

Q: Q.2. [Arithmetic Operators] Write a program to: (C++ Language) Sample Input / Output where the total...

A: Program code: //include required functions#include <iostream>;//main functionint main(){    //...

Q: Write a c program  Write a program which should consists of a user defined function Task (). Pass 1D...

A: The value at index i can be obtained by using pointer as*(arr+i) and without using pointers, you can...

Q: binomial tree, Bn is defined recursively as follows. B0 is the tree with a single vertex.Create Bn...

A: The following will be the tree diagram for the number of nodes being (n=4)-

Q: Matlab Question Write a function to return the index of the value that is nearest to a desired value...

A: The required code that has the declaration ind = FindNearest(x, desiredVal), is provided in the next...

Q: Given a non-dummy headed circular list, write down a method for inserting an elementinto the list.

A: The non dummy headed means it refers to the top of the single linked list. So here the question tell...

Q: Please explain the 4 questions on the bottom using the topology provided. Please provide reasoning f...

A: Given: R1#ping 10.5.5.55 source 10.1.1.1 Type escape sequence to abort. Sending 5,100-byte ICMP Echo...

Q: Could you help me create a python code for this question? Thanks

A: Consider a list for storing 25 students GPA You can use in-built function or you can also write a si...

Q: Using Queues. Java Program

A: The program is written in java

Q: write a program which should consist of a user defined function "maximum()" pass 1D array to the fun...

A: The User Driven C program is written where it will have the user defined function Maximum which will...

Q: 3. What are the possible operations that can be performed on pointers. Explain with help of suitable...

A: Operations performed on pointers: Pointers are variables that hold the address of the variable to wh...

Q: Explain data design terminology, including entities, fields, common fields, records, files, tables, ...

A: All these terms comes under relational databases. Relational databases are which stores data in the ...

Q: Michelle is writing an assignment on programming language. Help michelle complete the following stat...

A: The c programming language is a procedural(or) functional, general-purpose programming language and ...

Q: Shows the output of the following instructions? MOV AX,#10H MOV BX,#50H PUSH AX POP CX ADD BX,CX...

A: Objective: Two assembly codes are given to determine the output. Also, the steps should be mentioned...

Q: Circle the portion of the IP address that would be invalid if it were assigned to a host, and then e...

A:   To check given IP addresses portion are valid or not for the host and if it is invalid , also chec...