My assignment is to write a program that reads in a number from the user and then generates the hailstone sequence from that point
I'm not sure if I should use an if statement or string loop any advice?
The beginning of an attempt
#include <iostream>
#include <vector>
#include <string>
using namespace std;
vector<string> Numbers;
/// if n is equal to 1 the sequence has ended
/// if n is even divide the number by 2
/// if n is odd, multiply by 3 and add 1 to new number
int main()
{
n = num1
n%2 = num2
((3 ** n) + 1) = num3
vector<string>
num1 -- 8,4,2,1,
if(num1 == 4,2,1)
{
cout << "congradulations your hailstone sequence is has come to an end";
return 0;