Question

What C++ data type should be returned from the function/method? // Start //     Declarations //       num amount //       num...

What C++ data type should be returned from the function/method?

// Start

//     Declarations

//       num amount

//       num newAmount

//       num interestRate

//     output "Please enter the dollar amount.   "

//     input amount

//     output "Please enter the interest rate(e.g., nine percet should be entered as 9.0).   "

//     input interestRate

//     newAmount = FutureValue(amount,interestRate)

//     output "The new dollar amount is ", newAmount

// Stop

//

//

//

// num FutureValue(num initialAmount, num interestRate)

//     Declarations

//       num finalAmount

//     finalAmount = (1 + interestRate/100) * initialAmount

// return finalAmount

0 0
Add a comment Improve this question Transcribed image text
Answer #1
Data type should be returned from the function/method is double/float

double/float

Add a comment
Know the answer?
Add Answer to:
What C++ data type should be returned from the function/method? // Start //     Declarations //       num amount //       num...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • using the following pseudocode what C++ data types should be used for the variable "finalAmount" //...

    using the following pseudocode what C++ data types should be used for the variable "finalAmount" // Start Declarations num amount num newAmount num interestRate output "Please enter the dollar amount. // input amount output "Please enter the interest rate (e.g., nine percet should be entered as 9.0). // input interestRate newAmount FutureValue (amount, interestRate) // output "The new dollar amount is ", newAmount // Stop 17 num FutureValue (num initialAmount, num interestRate) Declarations num finalAmount finalAmount = (1 + interestRate/100)...

  • Please code this in C++: // Start // Declarations // number currentTuition // number futureTuition //...

    Please code this in C++: // Start // Declarations // number currentTuition // number futureTuition // number interestRate // number numYears // number year // // output "Please enter current tuition: " // input currentTuition // output "Please enter interest rate (e.g. 9.0 for 9 percent): " // input interestRate // output "Please number of years for tuition: " // input numYears // output “Tuition at year 1 is “, currentTuition // // futureTuition = currentTuition // for year =...

  • Part 1 – Data Encryption Data Encryption is the process of transforming data, using a cipher,...

    Part 1 – Data Encryption Data Encryption is the process of transforming data, using a cipher, to make it unreadable to anyone except those possessing special knowledge. In this problem you will implement a simple encryption technique on data that comprises of non-negative integers that have at least six digits with no leading zeroes. In order to encrypt the number the following functions are to be implemented: void input(int *num); int add4(int num); int shift(int num); void printOutput(int encryptNum, int...

  • In this assignment, you will be creating three static methods as described below: The method duplicate...

    In this assignment, you will be creating three static methods as described below: The method duplicate should accept one parameter of type String (named “str”). The method should return a String with every character in str repeated n times, where n is the length of str if str has an odd number of characters e.g. duplicate("Hat") should return "HHHaaattt" and n is double the length of str if str has an even number of characters E.g. duplicate("Hi") should return "HHHHiiii"....

  • C programm , ´hello i need your help -Given the C program primes.c with the following main method: int main() { int num, res; char buffer[11]; bool finished = false; while (!finished)...

    C programm , ´hello i need your help -Given the C program primes.c with the following main method: int main() { int num, res; char buffer[11]; bool finished = false; while (!finished) { printf("Enter n > 0 or quit\n"); scanf("%10s", buffer); if (strcmp(buffer, "quit") == 0) { finished = true; } else { // Convert input to number and compute n-th prime num = atoi(buffer); if (num > 0) { res = nth_prime(num); printf("Prime #%d is %d\n", num, res); }...

  • Need help problem 9-13 C++ Homework please help WRITE FUNCTION PROTOTYPES for the following functions. The...

    Need help problem 9-13 C++ Homework please help WRITE FUNCTION PROTOTYPES for the following functions. The functions are described below on page 2. (Just write the prototypes) When necessary, use the variables declared below in maino. mm 1.) showMenu m2.) getChoice 3.) calcResult m.) showResult 5.) getInfo mm.) showName 7.) calcSquare 8.) ispositive int main { USE THESE VARIABLES, when needed, to write function prototypes (#1 - #8) double num1 = 1.5; double num2 = 2.5; char choice; double result;...

  • C++ problem where should I do overflow part? in this code do not write a new...

    C++ problem where should I do overflow part? in this code do not write a new code for me please /////////////////// // this program read two number from the user // and display the sum of the number #include <iostream> #include <string> using namespace std; const int MAX_DIGITS = 10; //10 digits void input_number(char num[MAX_DIGITS]); void output_number(char num[MAX_DIGITS]); void add(char num1[MAX_DIGITS], char num2[MAX_DIGITS], char result[MAX_DIGITS], int &base); int main() { // declare the array = {'0'} char num1[MAX_DIGITS] ={'0'}; char...

  • I need help modifying this code please ASAP using C++ Here is what I missed on this code below Here are the instruction...

    I need help modifying this code please ASAP using C++ Here is what I missed on this code below Here are the instructions Here is the code Produce correct70 pts O pts Full Marks No Marks results and statisfy requirements view longer Comments 1. Your display amount is not readable 2. I withdraw more than my balance, but I didn't see any error message description Documentations10 pts 0 pts Full Marks No Marks : comment i code and block comment...

  • Need help with this homework, and follow the bolded text required 7.10 LAB: Data Visualization (1) Write a function, get_data_headers(), to prompt the user for a title, and column headers for a table....

    Need help with this homework, and follow the bolded text required 7.10 LAB: Data Visualization (1) Write a function, get_data_headers(), to prompt the user for a title, and column headers for a table. Return a list of three strings, and print the title, and column headers. (2 pt) Ex: Enter a title for the data: Number of Novels Authored You entered: Number of Novels Authored Ex: Enter the column 1 header: Author name You entered: Author name Enter the column...

  • In C++, Please help me compute the following flowchart exactly like this requirement: Use while loops...

    In C++, Please help me compute the following flowchart exactly like this requirement: Use while loops for the input validations required: number of employees(cannot be less than 1) and number of days any employee missed(cannot be a negative number, 0 is valid.) Each function needs a separate flowchart. The function charts are not connected to main with flowlines. main will have the usual start and end symbols. The other three functions should indicate the parameters, if any, in start; and...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT