Symbianize Forum

Most of our features and services are available only to members, so we encourage you to login or register a new account. Registration is free, fast and simple. You only need to provide a valid email. Being a member you'll gain access to all member forums and features, post a message to ask question or provide answer, and share or find resources related to mobile phones, tablets, computers, game consoles, and multimedia.

All that and more, so what are you waiting for, click the register button and join us now! Ito ang website na ginawa ng pinoy para sa pinoy!

-= Having Difficulties in C++ and Java? Be a Part of This Thread =-

Re: -= Having Difficulties in C++? Be a Part of This Thread =-

Mga master papano po kaya icode to?

Enter your name(LastName, FirstName, MI): dela Cruz, Juan P.
Your name is Juan P. dela Cruz

ginamitan po namin ng string manipulation functions yan. ang di ko lang po magets ay kung papaano maalis yung ','
kumbaga ganito ang lumalabas
Your name is Juan P. dela Cruz,
ito po bali yung code ko.

Code:
#include<iostream.h>
#include<conio.h>
#include<string.h>
#include<stdio.h>

main()

{
      char name[20], x[20], y[20];
      clrscr();
      cout<<"\nEnter your name (LastName, FirstName, MI):";
      gets(name);
      strcpy(x, strchr(name, ' '));
      strcpy(y, strrev(strchr(strrev(name), ',')));
      cout<<"\nYour name is" << x << y;
      getch();
      return 0;


}

thank you po sa makakatulong :)

Use the "strtok" function.

http://www.cplusplus.com/reference/cstring/strtok/
 
Re: -= Having Difficulties in C++? Be a Part of This Thread =-

pasali ako mga bossing :D
 
Re: -= Having Difficulties in C++? Be a Part of This Thread =-

Pagawa po ng program mga ka-symb ung Example po:

Enter a number: 5

2
5
3
4
1

HIGHEST: 5
LOWEST 1 Ganyan po pwede po pagawa??? :thanks: sa makakagawa :thumbsup:
 
Re: -= Having Difficulties in C++? Be a Part of This Thread =-

good day!! :)

i am an i.t student.

may i asked some question..if its ok..

what's the used of (using name std; ) ?

is this differnt from #include <stdio> ? :)

tnk u..

i just want to learn more ..this page is the best!!:thumbsup:
 
Last edited:
Re: -= Having Difficulty in C++? Be a Part of This Thread =-

mga idol need help naman sa prelim namin ,about c++ po sya ..gagawa daw po kami ng program na about buying eggs ..parang computerized way ng pagbili ng egg samin ..bale ganito po dapat lalabas pagnirun na sya ..
"Enter no. of eggs :
# of dozens :
and :
Price :
Total :
Due :
Change : "

sana po may makatulong sakin ..next week na po ipapasa namin yun :pray::pray::weep:

#include <iostream>
using namespace std;

void main () {
int eggs, doz, nd;
float price, total, due, change;
cout >> "Enter no. of eggs:";
cin >> eggs;
cout << endl;
doz=eggs/12;
nd=eggs%12;
cout << "# of dozens:" << doz << endl;
cout << "And:" << nd << " eggs" << endl;
if (eggs>=1 && eggs<=5)
price=8;
else if (eggs>=6 && eggs<=8)
price=7.50;
else if (eggs>=9 && eggs<=10)
price=7;
else if (eggs>=11 && eggs<=13)
price=6.50;
else
price=6;
cout << "Price:" << price << endl;
total=eggs*price;
cout << "Total:" << total << endl;
cout << "Due:";
cin >> due;
cout << endl;
change=due-total;
cout << "Change:" << change;
}

tama po codes ko?
 
Re: -= Having Difficulties in C++? Be a Part of This Thread =-

Pagawa po ng program mga ka-symb ung Example po:

Enter a number: 5

2
5
3
4
1

HIGHEST: 5
LOWEST 1 Ganyan po pwede po pagawa??? :thanks: sa makakagawa :thumbsup:

Code:
#include <iostream>
using namespace std;

int main(){
	
	int num, input;
	
	cout << "How many numbers you want to input? ";
	cin >> num;
	while(num < 1){
		cout << "\nInvalid input. Try another\n";
		cout << "How many numbers you want to input? :";
		cin >> num;
	}

	cin >> input;
	int low = input; 
	int high = input;
	
	for(int i=1; i<num; i++){
		cin >> input;
		if( input < low )
			low = input;
		else if(input > high)
			high = input;
	}
	
	cout << "Highest: " << high << endl;
	cout << "Lowest: " << low << endl;
	
	return 0;
}

good day!! :)

i am an i.t student.

may i asked some question..if its ok..

what's the used of (using name std; ) ?

is this differnt from #include <stdio> ? :)

tnk u..

i just want to learn more ..this page is the best!!:thumbsup:

malaki po pinagkakaiba ng dalawa..
yung #include <stdio> ay isa po siyang library..samantalang yung using namespaces std, hindi.

yung using namespace, ginagamit ko yun sa standard input and output ko..

ganito yung tamang code kapag walang "using namespace std" sa program mo

Code:
std::cin
Code:
std::cout

pero kung meron, ganito na siya
Code:
cout <<
Code:
cin >>
 
Re: -= Having Difficulties in C++? Be a Part of This Thread =-

sali po sir.. back to basics po ako sa c++.. thnks po ts
 
Re: -= Having Difficulties in C++? Be a Part of This Thread =-

sali po sir.. back to basics po ako sa c++.. thnks po ts

sige po, tulong-tulungan nlng po tayo dito :)
 
Re: -= Having Difficulties in C++? Be a Part of This Thread =-

pwede ba yung mga C na problema dito?
 
Re: -= Having Difficulties in C++? Be a Part of This Thread =-

master i have a problem about sa java. patulong naman master:help: :help: :help: :help: :help: :help: :help: :help:
 
Re: -= Having Difficulties in C++? Be a Part of This Thread =-

master i have a problem about sa java. patulong naman master:help: :help: :help: :help: :help: :help: :help: :help:

wala pa ako alam masyado sa java eh, pag aaralan plang namin this coming semester :slap:
 
Re: -= Having Difficulties in C++? Be a Part of This Thread =-

good news, open na rin ang thread na ito sa Java problems :D
 
sakto, may OOP(java) kami ngayun, I'm 2nd yr IT student! tnx sir raymund, aasahan ko po help nyo :)
 
eto po dapat yung output

enter birthyear
enter present year
your age is :

youre in legal age or youre minor
eto yung nagawa ko, kaso may mali eh.
sinadya ko pong alisin yung ibng symbol hirap kasi mag type sa cp
int main()
{
int by,py,age;

cout- enter birth year
cin-by
cout-enter present year
cin-py
cout-your age is <<py-by;
cin-age

if (age>=18)
cout-you are in legal age
else
cout- you are minor
getch();
}

ang problema sa code ko pag run na lumalabas naman yung age kaso di gumagana yung if kelangan mag input muna ako ng number tapus yung na input kong number ang ginagamit ng if na dapat yung age.
help me pls tnx...
 
Bakit ka nag cin << age?

Try:

age = py - by;
 
saang line ko ilalagay yan sir? oo ayan nga ang problem jan kaso di ko alam anung ilalagay tnx sa pag sagot sir..
 
change mo lang ang cin << age to age = py - by.
 
Back
Top Bottom