Question

1. Define an integer variable month with initial value 3 2. Draw Flowchart for the following question 3. Ask user to input on
0 0
Add a comment Improve this question Transcribed image text
Answer #1

1. int month = 3; //definition and initialization of the variable month

2. Incomplete Question

3.

#include<iostream>
using namespace std;

int main() {
int n;

cout<<"Enter a Number : ";

cin>>n;

if(n>0)

cout<<"Positive"<<endl;

else

cout<<"Negative"<<endl;
return 0;
}

4.

Variable Name Change in Variable
balance 1000,1628.8946267774414
ib 1000
n 10
r 0.05

Output:

After 10 years the balance is 1628.8946267774414

Add a comment
Know the answer?
Add Answer to:
1. Define an integer variable month with initial value 3 2. Draw Flowchart for the following...
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
  • I have this code, but I need a flowchart that shows how my program works, and...

    I have this code, but I need a flowchart that shows how my program works, and the inputs and outputs??? #include <iostream> #include <cmath> using namespace std; int fact(int n) { int i; int c = 1; for(i=1; i<=n; i++) { if(n==0) c = 1; else c = c*i; } return c; } double ex(int n,double x) { int i; double c = 0.0; for(i=0; i<=n; i++) { c = c + (double)(pow(x,i)/ (double)fact(i)); } return c; } double sinx(int...

  • Consider the following program in which the statements are in the incorrect order. Rearrange the statements...

    Consider the following program in which the statements are in the incorrect order. Rearrange the statements so that the program prompts the user to input the height and the radius of the base of a cylinder and outputs the volume and surface area of the cylinder. Formant the output to two decimal places. #include <iomanip> #include <cmath> int main () {} double height; cout << ”Volume of the cylinder = “ <<PI * pow(radius, 2.0) * height << endl; cout...

  • PLEASE TYPE OUT IN TEXT (please no pdf or writing) C++ CODE Consider the following program...

    PLEASE TYPE OUT IN TEXT (please no pdf or writing) C++ CODE Consider the following program in which the statements are in the incorrect order. Rearrange the statements in the following order so that the program prompts the user to input: The height of the base of a cylinder The radius of the base of a cylinder The program then outputs (in order): The volume of the cylinder. The surface area of the cylinder Format the output to two decimal...

  • a) A pointer is a variable that contains as its value the Ad of another 9.4...

    a) A pointer is a variable that contains as its value the Ad of another 9.4 Complete the output C++ Program Output #include <iostream> using namespace std; Ox10f055070 0x10f055078 char *suits[4] = {"hearts", "diamonds", "spades", "clubs"}; int main() { for (int i=0; i<4; i++){ cout << &suits[i] << endl; cout << endl; return 0; 9.5 Write the exact output Output C++ Program #include <iostream using namespace std; int maino

  • what is the output for the following code? explain the steps. /*#include <iostream> using namespace std;...

    what is the output for the following code? explain the steps. /*#include <iostream> using namespace std; int f(int &i) { i = 10; return(5 * i); } int main() { int n = 5; f(n); cout << n << "\n"; return 0; } #include <iostream> using namespace std; int sub1(int n) { n--; return n; } int main() { int m = 10; for(int j = 0; j < 10; j++) m -= sub1(j); cout << m << "\n"; return...

  • Im having trouble with this C++ program. Lab 10/object/test files provided LAB 10 1 //Savings.cpp - displays the account balance at 2 //the end of 1 through 3 years 3 //Created/revised by <your nam...

    Im having trouble with this C++ program. Lab 10/object/test files provided LAB 10 1 //Savings.cpp - displays the account balance at 2 //the end of 1 through 3 years 3 //Created/revised by <your name> on <current date> 4 5 #include <iostream> 6 #include <iomanip> 7 #include <cmath> 8 using namespace std; 9 10 //function prototype 11 double getBalance(int amount, double rate, int y); 12 13 int main() 14 { 15 int deposit = 0; 16 double interestRate = 0.0; 17...

  • 2. What is the value of x alter the following code is executed # include<iostream> using...

    2. What is the value of x alter the following code is executed # include<iostream> using namespace std; int main int t-0, c- 0,x-3; while (c < 4) t=t+x; cout << x return 0; a) 3 b) 21 c) 24 d) 48 3. What is the output of the following code? # include<iostream> using namespace std; int main0 int a- 3; for (int i 5; i >0; i) a a+i cout << a << “ “ return 0; d) 8...

  • a) Make a function which returns x/3 with a given integer x. double third(int x) {...

    a) Make a function which returns x/3 with a given integer x. double third(int x) { //Complete your code below. ______________________________________ return y; } b) Make a program which shows 2 ∗ n with a given user input n. #include<iostream> using namespace std; // Complete the blank. _______________________ int main(){ int n; cout<<"Enter:"; cin>>n; cout<<twice(n); return 0; } int twice(int x){ return 2*x; } c) Make a function which returns true if n is positive, otherwise returns false. ________ positive(int...

  • B) draw the runtime stack fall the steps (a) write the output of the following program....

    B) draw the runtime stack fall the steps (a) write the output of the following program. The output must include everything that a computer may produce on its screen, including the prompts, input, output, and their positions. Suppose the input integers are 1 and 2, in this order. (b) Draw the run time stack for every step of execution on the next page. You need to mark the return address(es) yourself. #include <iostream> using namespace std; int a; int b;...

  • IV. Function Tracing (20 points) Trace the following program. Show llof your work and the ound...

    IV. Function Tracing (20 points) Trace the following program. Show llof your work and the ound he output in the work including labeled boxes for user-defined functions, calculations, and the output in designated spaces. You should draw a box for each variable and show value updates d the output, Show all of your #include <iostream» using namespace std; void mickey (int sa, int b, int &c) void minnie(int u, int &v, int w); void pluto (int m, int n, int...

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