giftalp 0 Newbie Poster

Your sarcasm is unwarranted. You have to "help us help you". You are not paying for this help, so if it is annoying, no one will help you (as you noticed).

First, I think, I have showed some effort. I put my code inside code tags, when you asked. I have cleaned my code from comments, when you asked. Finally I put beginning of my code. And what I have got just "put code tags" and this is it. It was like I sink and you said clean your teeth and then I will help you. I was really needed help. You didn't give me any advice like put ";", if I missed it. It is not annoying, if after this, help follows. Yes, I have not paid for this help, but nobody asked me about money. I think not everything can be paid by money.

giftalp 0 Newbie Poster

What kind of tags did you use? You should use

[ code ] your code here [ /code ] (without the spaces between the word 'code' and the brackets. Also, if you remove the massive comments the code will be much more manageable for the forum :)

Thank you for your "help" it was very "valuable". :icon_frown:

giftalp 0 Newbie Poster

I have done this program, I put it below, so if somebody interested can use it.

My main function

// calcumenu.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"


// ================
 // Class Inclusions
 // =====================

 // Include MenuClass.h in the stdafx.h file instead of here.
 // #include "MenuClass.h"
 // =====================

 // =============
 int main( ) {

 // ================================
 // Variable and Object Declarations
 // ================================
      classMenu menu;
 // ===============

 // ======
 // NOTES:
 //
 // 1) Since Display(), QueryUser(), and ProcessCommand() are all
 // members of the Menu class, they are able to obtain the
 // necessary data to be able to perfrom their function directly
 // from the private member variable userMenuSelection. No
 // values need be passed via arguments.
 // 2) Now, and anon, does this main() function behave as the conductor
 // of an orchestra. Never playing an instrument, the conductor,
 // using a little baton, simply directs those playing instruments.
 // And main(), likewise, executes at an abstract level, while the
 // various member-functions invoked by main() perform the detailed,
 // low-level, and intricate tasks of program execution.
 // =======================================================
     do {
         menu.Display();
         menu.QueryUser();
         menu.ProcessCommand();

        } while ( menu.Continue() ); // do ... while loop
// =================================================

    return 0;

} // Function main()
// ====================

Here is my class Menu:

#include "StdAfx.h"
#include <iostream>
#include <string>

// Include Number.h and MenuClass.h in the stdafx.h file instead of here.

// ==================

// ====================
 using namespace std;
// ====================

// …
giftalp 0 Newbie Poster

So, nobody wants to help me? :(

giftalp 0 Newbie Poster

Is it work :)

giftalp 0 Newbie Poster
#include "StdAfx.h"
#include <string>
#include <iostream>



using namespace std;

Number::Number( void ) {

cout << "Default constructor invoked: Number( void )." << endl;
number = 0;
} 
Number::Number( int integerValue ) {

cout << "Non-Default constructor invoked: Number( int )." << endl;
number = integerValue;
} 
Number::~Number( void ) {

cout << "Destructor ~Number invoked." << endl;

} 
int Number::Get( ) {

return number;

} 


void Number::Set( int integerValue ) {

number = integerValue;

} 


void Number::Output( ) {
cout << number << endl;
cout << endl;

}
void Number::Add( Number otherNumber ) {

number = number + otherNumber.Get();

}



void Number::Subtract( Number otherNumber ) {
	
	number = number - otherNumber.Get();
}

int Subtract(Number numA, Number numB){
	int answer;
	answer = numA.Get() - numB.Get();
	return answer;
}

void Number::Multiply(Number otherNumber) {
	
	number = number * otherNumber.Get();
}




void Number::Divide(Number otherNumber) {
	
	number = number /  otherNumber.Get();

}
giftalp 0 Newbie Poster
#include "StdAfx.h"
#include <iostream>
#include <string>




 using namespace std;

classMenu::classMenu( void ) {

userMenuSelection = Quit;

} 

classMenu::~classMenu( void ) {
cout << "Destructor ~Menu invoked." << endl;

} 
MenuChoices classMenu::Get( ) {

return userMenuSelection;

} 
void classMenu::Set( MenuChoices newValue ) {

userMenuSelection = newValue;

} 
void classMenu::Display( ) {

cout << "1: Quit" << endl;
cout << "2: Sum"<< endl; 
cout <<	"3: Difference" << endl;
cout << "4: Product" << endl;
cout << "5: Quotient" << endl;

} 
void classMenu::QueryUser( ) {

int selection;

cout << "Enter Menu Selection: ";


cin >> selection;

switch (selection){
case 1: userMenuSelection = Quit;
break;

case 2: userMenuSelection = Sum;
break;

case 3: userMenuSelection = Difference;
break;

case 4: userMenuSelection = Product;
break;

case 5: userMenuSelection = Quotient;
break;

default: userMenuSelection = Quit;
} 

cout << endl;

} 
bool classMenu::Continue( ) {

return userMenuSelection != Quit;

} 
void classMenu::ProcessCommand( ) {

int numA;
int numB;
Number numberA;
Number numberB;
Number numberC(0);

if ( userMenuSelection != Quit ){


cout << "Enter an integer value: ";
cin >> numA;
numberA.Set(numA);

cout << "Enter an integer value: ";
cin >> numB;
numberB.Set(numB);
cout << endl;

switch ( userMenuSelection ) {

case Sum: numberC.Add(numberA);
numberC.Add(numberB);
cout << numberA.Get() << " + " << numberB.Get() << " = "// This part is work
 << numberC.Get() << endl;
break;



case Difference: numberC.Subtract(numberA);
numberC.Subtract(numberB);
cout << numberA.Get() << " - " << numberB.Get() << " = "  // this part does not work //properly
 << numberC.Get() << endl; …
giftalp 0 Newbie Poster

I have created class menu and class number. I would like that my functions in class do sum, subtract, multiply, and divide. I've done sum, but I have problems with other functions. When I do difference, it is actually sum my numbers, and result of multiplication and division is 0 all the time. Could somebody help me with this problem. I have attached my implementation files and header files.

giftalp 0 Newbie Poster

Simple Dude just three line.. B4 running make sure that
two Dir ie FileData and CopiedData should be in same directory

#!/bin/sh
mkdir -p CopiedData
cp ./FileData/* ./CopiedData/

Thank you very much

giftalp 0 Newbie Poster

I need write simple script,but I just started and don't know how to do this at all. And I need it before tomorrow.
This is what I need.
1) Create a directory FileData and place four files into the directory.
This part, I already did, but second still exist.
2) Implement a Linux script that creates a new directory called CopiedData and when then copies the four files from FileData into CopiedData.

Can anybody help me? And if you can put comments for me to understand.
Thank you

giftalp 0 Newbie Poster

if it help you use it welcome.

giftalp 0 Newbie Poster

This is my final code of program that counts vowels.

#include "stdafx.h"
#include <iostream>
//=================

//======================
	using namespace std;
//======================

//======================
//Function Prototypes
//======================
	bool isVowel ( char );
//======================




// IsVowel Function
//+++++++++++++++++++
	bool isVowel (char letter) {
		switch (letter) {
			case 'a': return true;
			break;
			case 'e': return true;
			break;
			case 'i': return true;
			break;
			case 'o': return true;
			break;
			case 'u': return true;
			break;
			case 'y': return true;
			break;
			default: return false;
		}//switch
	} // isVowel function
int main()
{

// Variable Declaration
//+++++++++++++++++++++

	int vowelcounter;
	char letter;
	char askuser;
	char repeat;
	bool loop;
	bool finished = true;
//+++++++++++++++++++++++

//+++++++++++++++++++++++
//Welcome Screen
//++++++++++++++
	cout << " " << endl;
	cout << "YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY" << endl;
	cout << "Y                                    Y" << endl;
	cout << "Y   Welcome to the IsVowel program   A" << endl;
	cout << "A                                    A" << endl;
	cout << "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" << endl;
	cout << " " << endl;
// Loop
//+++++

	do {
		loop = true;
		vowelcounter = 0;
//+++++++++++++++++++++++

//+++++++++++++++++++++++
		do {
			cout << " Enter a character " << endl;
			cin >> letter;
			if (isVowel (letter))
				vowelcounter++;
			cout << " Would you like to enter another character? (y/n) " << endl;
			cin >> askuser;
			if ( askuser == 'n' ) {
				loop = false;
			}
		}// 2nd do
		while (loop);
		cout << " Number of vowels: " << vowelcounter << endl;
		cout << " Would you like repeat? (y/n) " << endl;
		cin >> repeat;
		if (repeat == 'n')
			finished = false;
	} while (finished);


	return 0;
}
giftalp 0 Newbie Poster

Thank you very much:idea:

giftalp 0 Newbie Poster

So you want to count how much times a certain vowel is encountered in the sequence of characters?

Is this right?

Yes, I need get number of vowels in the sequence.

giftalp 0 Newbie Poster

I have problem to start. I need algorithm for program that prompts the user to input a sequence of characters and outputs the number of vowel, using user-defined value returning function Vowel.

Please help