Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a C++ program in a file named change. cpp that asks the user to input a nu

ID: 3801539 • Letter: W

Question

Write a C++ program in a file named change. cpp that asks the user to input a number of cents between 0 and 99 cents and outputs the number of quarters, dimes, nickels, and pennies to make change for that amount. Use the minimum number of coins possible. Do not out zero for any of the coins (i.e., in the sample below, it did not output zero nickels). The following is a sample output: Write a C++ program in a file named invest.cpp that asks the user to input an annual investment amount, the interest rate earned every year, and the number of years (an integer). The program outputs the final value of the investment assuming the same amount is invested at the beginning of each year and the interest is compounded annually. The following is a sample output: Write a C++ program in a file named primes.cpp that asks the user to input a number and outputs all the numbers between 2 and the number entered (including that number) that are prime. The following Is a sample output:

Explanation / Answer

#include <iostream>

using namespace std;

int main()
{
int quarter,dime,cents,nickels,pennies;
cout<<"enter amount (0-99) :";
cin>>cents;
quarter=cents/25;

if(quarter>0)
{
cents=cents%25;
cout<<"quarters:"<<quarter<<endl;
}
if(cents/10>0)
{
dime=cents/10;
cents=cents%10;
cout<<"dime:"<<dime<<endl;
}
if(cents/5>0)
{

nickels=cents/5;
cents=cents%5;
cout<<"nickels:"<<nickels<<endl;
}
if(cents>0)
{

pennies=cents;
cout<<"pennies:"<<pennies<<endl;
}


return 0;
}
output
enter amount (0-99) :63
quarters:2
dime:1
pennies:3

#include <iostream>
#include<cmath>
using namespace std;

int main()
{

int i,a,t;
float r;
cout<<"Enter amount invested each year:";
cin>>a;
cout<<"Enter intrest rate:";
cin>>r;
cout<<"enter number of years";
cin>>t;

i=a*pow((1+r),t)
cout<<i;
return 0;
}
output
Enter amount invested each year:5000
Enter intrest rate:0.07
enter number of years20
19348

#include <iostream>
#include<cmath>
using namespace std;


int main ()
{
int n;
cout<<"enter the last interval:";
cin>>n;


for (int i=2; i<n; i++)
{
bool prime=true;
for (int j=2; j*j<=i; j++)
{
if (i % j == 0)
{
prime=false;
break;
}
}
if(prime) cout << i <<endl;
}
return 0;
}


enter the last interval:20
2
3
5
7
11
13
17
19

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote