#include <iostream>
#include <cmath>
#include <cstdlib>
int main(){
using namespace std;
double a;
double b;
double c;
double d;
double e;
double f;
double g;
double y;
double n;
cout << "Welcome to Justin's Infinite Geometric Solver!" << endl;
g=y;
while (g=y){
cout << "Input the first term of the infinite geometric series: " << endl;
cin >> a;
cout << "Input the second term of the infinite geometric series: " << endl;
cin >> b;
cout << "Input the third term of the infinite geometric series: " << endl;
cin >> c;
d = abs(c/b);
e = 1 - d;
if(d > 1){
cout << "Diverges!" << endl;
cout << "Would you like to find another sequence? (y or n)" << endl;
cin >> g;
}
else{
f = a/e;
cout << "The sum of this infinite geometric sequence is " << f << endl;
cout << "Would you like to find another sequence? (y or n)" << endl;
cin >> g;
}
}
cin.get();
return 0;
}
#include <iostream>
#include <cmath>
#include <cstdlib>
int main(){
using namespace std;
double a;
double b;
double c;
double d;
double e;
double f;
double g;
double y;
double n;
cout << "Welcome to Justin's Infinite Geometric Solver!" << endl;
g=y;
while (g=y){
cout << "Input the first term of the infinite geometric series: " << endl;
cin >> a;
cout << "Input the second term of the infinite geometric series: " << endl;
cin >> b;
cout << "Input the third term of the infinite geometric series: " << endl;
cin >> c;
d = abs(c/b);
e = 1 - d;
if(d > 1){
cout << "Diverges!" << endl;
cout << "Would you like to find another sequence? (y or n)" << endl;
cin >> g;
}
else{
f = a/e;
cout << "The sum of this infinite geometric sequence is " << f << endl;
cout << "Would you like to find another sequence? (y or n)" << endl;
cin >> g;
}
}
cin.get();
return 0;
}
#include <iostream>
#include <cmath>
#include <cstdlib>
using namespace std;
int exit();
int main() {
double a;
double b;
double c;
double d;
double e;
double f;
cout << "Welcome to Justin's Infinite Geometric Solver!" << endl;
cout << "Input the first term of the infinite geometric series: " << endl;
cin >> a;
cout << "Input the second term of the infinite geometric series: " << endl;
cin >> b;
cout << "Input the third term of the infinite geometric series: " << endl;
cin >> c;
d = abs(c/b);
e = 1 - d;
if(d > 1){
cout << "Diverges!" << endl;
}
else{
f = a/e;
cout << "The sum of this infinite geometric sequence is " << f << endl;
}
exit();
}
int exit() {
char g;
cout << "Would you like to find another sequence? (y or n)" << endl;
cin >> g;
if(g == 'y' {
main();
}
else if (g=='n' {
return 0;
}
else return 0;
}
#include <iostream>
#include <cmath>
#include <cstdlib>
using namespace std;
int exit();
int main() {
double a;
double b;
double c;
double d;
double e;
double f;
cout << "Welcome to Justin's Infinite Geometric Solver!" << endl;
cout << "Input the first term of the infinite geometric series: " << endl;
cin >> a;
cout << "Input the second term of the infinite geometric series: " << endl;
cin >> b;
cout << "Input the third term of the infinite geometric series: " << endl;
cin >> c;
d = abs(c/b);
e = 1 - d;
if(d > 1){
cout << "Diverges!" << endl;
}
else{
f = a/e;
cout << "The sum of this infinite geometric sequence is " << f << endl;
}
exit();
}
int exit() {
char g;
cout << "Would you like to find another sequence? (y or n)" << endl;
cin >> g;
if(g == 'y' {
main();
}
else if (g=='n' {
return 0;
}
else return 0;
}
Copyright © 2024, NextGenUpdate.
All Rights Reserved.