Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - annefrank

Pages: [1]
1
Operating System / Re: Error
« on: November 24, 2013, 04:20:34 pm »

No, i have not yet tried the steps given on that page  and sorry for a bad topic name.No , ubuntu is not saved on HDD.

2
Operating System / Error loading Ubuntu
« on: November 24, 2013, 03:52:16 pm »
I have Dell vostro 1550. I installed ubuntu12.10 on that about a week ago and then after some  time I reinstalled the Window 7 32-bit. It worked well at that time. yesterday I installed its graphics driver and today when I switched on my laptop I got following error:
Could not find kernel image: linux picture
Please Help to make it understand me.Why did this happen?

3
Anonymity and Privacy / Re: VPN connection problem
« on: October 03, 2013, 01:01:48 pm »
I used Ultrasurf in old days, when it was not blocked. And also the same problem happened at that time too when it was not blocked. and i guess when i use vpn my ipaddress is changed and main server of my college logs me out when it finds  different ip address . :-\

4
Anonymity and Privacy / VPN connection problem
« on: October 03, 2013, 12:03:53 pm »
As most of the proxies do not work in my college .(Cyberoam is used in my college and everytime i access the internet , i have to login with my username and password ). So, I tried to use VPN . But now there is one more problem after every 10 minutes my connections are lost and i have to login again and again after every 10 minutes. So, tell me why do this happen? and what should i do so that i could connect to internet as long as i don't log out .

5
C - C++ / Re: problem with inheritence in c++.
« on: April 08, 2013, 07:20:06 pm »
1. Also I don't see any correct class usage. I think you are expecting the class members to pop up in global namespace.
2. That is wrong. Correct class usage is - MyClass myInstance; create a instance of the class. Then you would access the member function like this myInstance.memberFunction.
I didn't get you actually. I have used object to call the member functions of a class at the last in void main same as above told by you. Am i wrong? If yes then tell me the right  method.

6
C - C++ / Re: problem with inheritence in c++.
« on: April 07, 2013, 09:29:36 pm »

 
       
     
 

As for the error, I don't get the one you are talking about, what compiler are you using?
And yes, I fixed the "<*.h>" and "using * *;"
i am using turbo c++

7
C - C++ / Re: problem with inheritence in c++.
« on: April 07, 2013, 09:25:05 pm »
I tried compiling the program . Some of the errors were related to escape sequencing . Why would you do this ?
cout<<"\earth";
there is no \e escape sequence , a bunch of errors were like this .
Secondly

else(){} doesn't make sense to me
else if(){} is the correct way .

Third use#include <iosteam> not iostream.h
Fourth , use std::cout,std::endl,std::cin or "using namespace std;" before main .
Now I haven't run the program but it compiled properly , Nobody can help you with the inheritance problem or if the program behaves abnormally . You didn't mention what this program was supposed to do and what was the problem(after execution).

And p.s don't make a function inline when it is more than 3 lines of code , I see you've made a few functions inline which are like 30 lines long.
I dont know about "using namespace std". I have never used . Can you please elaborate?
and i also dont know about inline functions, i got the inline function error many times but never understand what really it is?

8
C - C++ / Re: problem with inheritence in c++.
« on: April 07, 2013, 08:41:27 pm »
Oh god WHY!!!!!!, Please use [code ][/code ] tags and proper formatting...
thanks.. :)

9
C - C++ / problem with inheritence in c++.
« on: April 07, 2013, 08:30:15 pm »
//A program related to "Quiz". I have  3 lifelines to use in any number of ques. but my program is giving some kind of inheritence error. here, I have done programming upto 2 ques only my 1st ques is running but when i come up with second question with many  possibilities it shows  some kind of error. please help me. 
 
Code: ( cpp) [Select]

#include<iostream.h>
#include<conio.h>
class A
{
public:
int fif,aud,ask,r,P;
void life1();   //  lifeline declaration. when none of the lifeline is used.
};
void A::life1()
{
fif=0;
ask=0;
aud=0;
P=0;
cout<<"You have 3 lifelines:\n";
cout<<"Audience Poll\n";
cout<<"Computer Ask\n";
cout<<"Fifty fifty\n";
cin>>r;
if(r==1)
{
aud++;  // get added when audience poll will be used.
}
if(r==2)
{
ask++;
}
if(r==3)
{
fif++;
}
P++;      //get added by 1 when any one of them is used
}
class Ba : public A  // when one from three of them is used.
{
public:
int t,O;
void life2a();
};
void Ba::life2a()
{
O=0;
cout<<"You have 2 lifelines:\n";
cout<<"Audience Poll\n";
cout<<"Fifty Fifty\n";
cin>>t;
if(t==1)
{
aud++;
}
if(t==2)
{
fif++;  // get added when fifty-fifty will be used
}
O++;  // get added by 1 when any one of them will be used.
}
class Bb : public A // when one from three of them is used
{
public:
int y,L;
void life2b();
};
void Bb:: life2b()
{
L=0;
cout<<"You have 2 lifelines:\n";
cout<<"Audience Poll\n";
cout<<"Computer Ask\n";
cin>>y;
if(y==1)
{
aud++;
}
if(y==2)
{
ask++;
}
L++;
}
class Bc: public A // when one from three of them is used
{
public:
int u,Y;
void life2c();
};
void Bc::life2c()
{
Y=0;
cout<<"You have 2 lifelines:\n";
cout<<"Computer Ask\n";
cout<<"Fifty-Fifty\n";
cin>>u;
if(u==1)
{
ask++;
}
if(u==2)
{
fif++;
}
Y++;
}
class Ca: public A // when only one lifeline left to use.
{
public:
int K;
void life3a();
};
void Ca::life3a()
{
K=0;
cout<<"You have only 1 lifeline:\n";
cout<<"Computer ask\n";
ask++;
K++;
}
class Cb: public A // when only one lifeline left to use.
{
public:
int J;
void life3b();
};
void Cb::life3b()
{
J=0;
cout<<"You have only 1 lifeline:\n";
cout<<"Fifty-Fifty\n";
fif++;
J++;
}
class Cc : public A // when only one lifeline left to use.
{
public:
int B;
void life3c();
};
void Cc::life3c()
{
B=0;
cout<<"You have only 1 lifeline:\n";
cout<<"Audience Poll\n";
aud++;
B++;
}
class ques
{
public:
int ans1,ans2,ans3;
char q,z;
void ques1()
{
cout<<"Which  planet is called as REd planet ?\n";
cout<<"your options are :\n";
cout<<"1.Mars\n";
cout<<"2.jupiter\n";
cout<<"3.earth\n";
cout<<"4.uranus";
cout<<"\nif you want to use lifeline then enter y else n";
cin>>q;
if(q=='y'||q=='Y')
{
void life1();
{
if(r==1)
{
cout<<"1.80%\n";
cout<<"2.10%\n";
cout<<"3.6%\n";
cout<<"4.4%\n";
}
else if(r==2)
{
cout<<"Mars\n";
}
else (r==3)
{
cout<<"Mars /earth\n";
}
}
else
{
cout<<"Give an answer:\n";
cin>>ans1;
switch(ans1)
{
case 1:
cout<<"right answer\n";
break;
case 2:
cout<<"sorry your answer is wrong\n";
break;
case 3:
cout<<"sorry your answer is wrong\n";
break;
case 4:
cout<<"sorry your answer is wrong\n";
break;
}
if(ans1==1)
{
cout<<"You won Rs.1000\n"
}
}
}
void ques2()
{
cout<<"Your second ques is:\n";
cout<<"Light year is a unit of?";
cout<<"Your options are:\n intensity of light ";
cout<<"2. distance\n";
cout<<"3. time\n";
cout<<"4.planetary motion\n";
cout<<"\nif you want lifeline then press y else n:\n ";
cin>>z;
if(z=='y'||z=='Y')
{
if(P==1&&ask==1)
{
life2a();
if(t==1)
{
cout<<"\n1. 10%\t";
cout<<"2. 80%\t";
cout<<"3. 6%\t";
cout<<"4. 4%\n";
}
if(t==2)
{
cout<<"\ndistance\n/time\n";
}
}
else if(P==1&&aud==1)
{
life2c();
if(u==1)
{
cout<<"\ndistance\n/time\n";
}
if(u==2)
{
cout<<"distance\n";
}
}
else if(P==1&&fif==1)
{
life2b();
if(y==1)
{
cout<<"\n1. 10%\t";
cout<<"2. 80%\t";
cout<<"3. 6%\t";
cout<<"4. 4%\n";
}
if(y==2)
{
cout<<"distance\n";
}
}
else
{
life1();
if(r==1)
{
cout<<"1.10%\n";
cout<<"2.80%\n";
cout<<"3.6%\n" ;
cout<<"4.4%\n";
}
if(r==2)
{
cout<<"\ndistance\n/time \n";
}
if(r==3)
{
cout<<"\distance\n";
}
}
}
else
{
cout<<"Give ans:\n";
cin>>ans2;
switch(ans2)
{
case 1:
cout<<"sorry your answer is wrong\n";
break;
case 2:
cout<<" your answer is right\n";
break;
case 3:
cout<<"sorry your answer is wrong\n";
break;
case 4:
cout<<"sorry your answer is wrong\n";
break;
}
if(ans2==2)
{
cout<<"You won Rs.2000\n";
}
}
};
 
void main()
{
clrscr();
ques q;
q.ques1();
q.ques2();
getch();
}

Pages: [1]