whaug000 0 Newbie Poster

Problem Description
In this assignment you are to write a program that encrypts an entire string, which could be multiple lines of text. Use the encrypted formula from last assignment to perform the encryption.

The program will ask the user for a string to manipulate. The original string will then be displayed in a field of 60 characters wide. That is, the last character on each line of output will be in column 60. This will create a sort of justified output. Words will be broken up where normally they would not, and this is fine for now. Later we can fix this, but we need functions and we have not covered those yet. Stay away from them at this time.

Next you will convert the string to all lowercase and display it, then uppercase and display it and finally encrypt it and yes, display it again. Refer to the screenshot for exact formatting details. Do not deviate one iota from what I show. 

This is what i have so far but i need an upper case loop of an entire string sentence and a lower case loop

[#include <iostream>
#include<string>

using namespace std;

int main()
{

	string sent;
	char ch, code;
	int newch = 0;
	int slength, change;

	cout << "Programmed by Wesley Haug" << endl << endl
		 <<	"Enter some text and I will encrypt it. " 
		 << "Do not press the enter" << endl 
		 <<	"until you are done." << endl << endl;

		getline(cin, sent);
	slength = sent.length(); //created as a loop finish
	
	//Lower case//
	cout << "--------------------" 
		 << "--------------------"
		 << "--------------------"
		 << endl <<endl;
	

	
	
	
	cout << "--------------------" 
		 << "--------------------"
		 << "--------------------"
		 << endl <<endl;
	
	//Capital Letters//
	cout << "--------------------" 
		 << "--------------------"
		 << "--------------------"
		 << endl <<endl;


	


	cout << "--------------------" 
		 << "--------------------"
		 << "--------------------"
		 << endl <<endl;
	//Encrypted last output//
	cout << "--------------------" 
		 << "--------------------"
		 << "--------------------"
		 << endl ;

	while (newch < slength){
		ch = sent[newch];
	
	if (ch >= 32 && ch < 79){
		change = 79 - ch;
		code = 79 + change;
		cout << code;
	}
	if (ch >= 79 && ch <=126){
		change = ch - 79;
		code = 79 - change;
		cout << code;
	}
	if ( newch % 60 == 0 && newch != 0 ){
		cout << endl; }

	newch++;
	}
	cout << endl;
	cout << "--------------------" 
		 << "--------------------"
		 << "--------------------"
		 << endl;

	cout << endl << endl;
	return(0);

}   //end main