₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,325,067 members, 8,420,143 topics. Date: Thursday, 04 June 2026 at 12:08 PM

Toggle theme

Solomon201's Posts

Nairaland ForumSolomon201's ProfileSolomon201's Posts

1 2 3 4 5 (of 5 pages)

ProgrammingRe: How Do I Get A Value From Another Form Using C#.NET 2008 by solomon201(m): 10:35am On Sep 01, 2012
I remember struggling with same problem for about 2 weeks when i was starting out newly. You can do it in two ways:constructor initialization and events. First and easiest you should have an overloaded constructor of the form you want to pass data to. Like public mynewform( string value) { // set and initialize your fields like textboxes and labels here.
Textbox1.text=value;
} then in your main form do something like this in the click event of the btn that creates and displays the new form:
string myname="john";
mynewform nameform=new mynewform(myname); nameform.show(); note this method works when the form is not yet created if you have the form already open along with other forms and want other forms to update another form automatically then you have to go through events. Let the parent or sending form have an event and then let the forms that need to be updated hook up to this event. With this way you can update multiple forms automatically at the same time. Sorry i'm using a phone i would have added very clear code samples.
ProgrammingRe: Pls Where Can I Get Html5 Video's In .iso Format by solomon201(m): 3:15pm On Aug 26, 2012
Freely i downloaded so freely i also give. if the poster needs it i can send it to him..
ProgrammingRe: Pls Where Can I Get Html5 Video's In .iso Format by solomon201(m): 9:21am On Aug 26, 2012
I have the training video from pluralsight they are very good at what they do even Microsoft use them for training people. Too bad demonoid has been taken down i would have sent u the link. I was lucky to have downloaded it before the take down. You can reach me on 07039477484
ProgrammingRe: C# Question........help??? by solomon201(m): 3:15pm On Jun 03, 2012
Check this one. It starts with random values for ur attributes

This is the Pokemon.cs file:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Pokemon
{
class Pokemon
{
public int hunger { get; set; }
public int Happiness { get; set; }
public int Fight {get; set;}
public int Energy { get; set; }

public Pokemon()
{
Random gen = new Random(DateTime.Now.Second);

hunger = gen.Next(40, 60);
Happiness = gen.Next(50, 70);
Fight = gen.Next(25, 60);
Energy = gen.Next(30, 70);
}

public void Play()
{
Happiness += 5; Energy -= 10; hunger += 4;
CheckRules();

}

private void CheckRules()
{
if (Energy < 15)
Happiness -= 1;
if (hunger > 90)
Happiness -= 3;
}

public void Sleep()
{
Energy += 30; hunger -= 5;
CheckRules();
}


public void Eat()
{
hunger -= 10;
Happiness += 3;
CheckRules();
}

public void Work()
{
hunger += 15;
Energy -= 10;

}

public bool IsGameStillValid()
{
if (Happiness < 0 || Happiness > 100)
return false;
if (hunger < 0 || hunger > 100)
return false;
if (Fight < 0 || Fight > 100)
return false;
if (Energy < 0 || Energy > 100)
return false;
return true;
}

public void DisplayStats()
{
Console.WriteLine("Value of your Attributes are:"wink;
Console.WriteLine("Happiness: {0}",Happiness);
Console.WriteLine("Hunger: {0}", hunger);
Console.WriteLine("Fight: {0}", Fight);
Console.WriteLine("Energy: {0}", Energy);
}
}
}


And this is the Program.cs file
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Pokemon
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("\t\t\tWelcome to Pokemon!!!"wink;
Console.Write("\t\t"wink;
for(int x=0;x<35;x++)
Console.Write("*"wink;
Console.WriteLine();
bool IsValid;
int rounds=0;
string choice=null;
Pokemon you= new Pokemon();
IsValid=you.IsGameStillValid();
Console.WriteLine();
you.DisplayStats();
Console.WriteLine();
Console.WriteLine();
Console.WriteLine("Warning!!!!\nIf any of your attributes is below 0 or above 100 the game ends"wink;
Console.WriteLine();
Console.WriteLine("Game on Press any key to begin..."wink;
Console.ReadLine();
Console.Clear();

DisplayMenu();
while(IsValid)
{
rounds+=1;
choice=Console.ReadLine();
choice=choice.ToUpper();
switch(choice)
{
case "S": you.Sleep();
break;
case "P": you.Play();
break;
case "E": you.Eat();
break;
case "W": you.Work();
break;
default:
{
Console.WriteLine("Invalid Choice Made "wink;
Console.ReadLine();
Console.WriteLine();
return;
}
}
IsValid=you.IsGameStillValid();
Console.Clear();
Console.WriteLine("Game Still On!"wink;
Console.WriteLine();
you.DisplayStats();
Console.WriteLine();
DisplayMenu();

}
Console.WriteLine();
Console.WriteLine("You Played {0} rounds of Pokemon and finished with the following Stats",rounds);
Console.WriteLine();
you.DisplayStats();
Console.ReadLine();
}

private static void DisplayMenu()
{
Console.WriteLine("Select Action\n"wink;
Console.WriteLine("P=Play"wink;
Console.WriteLine("S=Sleep"wink;
Console.WriteLine("E=Eat"wink;
Console.WriteLine("W=Work"wink;
}

}
}

Hope it close to what u need if not modify
EventsRe: Computer Science Students' Congress by solomon201(m): 6:46am On Mar 14, 2012
Guyz I rili wanted to attend this conference oh but the distance from where i stay was far. Can u guyz give more info about the conference? If u dont mind share materials if there are.
ProgrammingRe: Coding Challenge 6: Working With Arrays by solomon201(m): 4:55pm On Jul 18, 2011
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Cha
{
class Program
{
static int absolute(int n)
{
if(n<0)
return ((n+(n*-2)));
else return n;
}

static int FindNearest(int[] n, int target)
{
int nearest=target;
int initial = absolute(n[0] - target);
foreach (int x in n)
if (absolute(x - target) < initial)
nearest = x;
return nearest;
}




static void Main(string[] args)
{
int[] numbers = { 19, 9, 30, 47, 5, 10, 20, 36, 21, 11, 13 };
int answer = FindNearest(numbers, 25);
Console.WriteLine(answer);
}
}
}
ProgrammingRe: Python Vs Java by solomon201(m): 10:37pm On Jun 25, 2011
I love Python syntax, its easy to read n understand
ProgrammingRe: Python Vs Java by solomon201(m): 10:21pm On Jun 25, 2011
I bet Fayimora can swear by JAVA, if JAVA its d future what is d future of C#?? I'll like to know pls
ProgrammingRe: C++ by solomon201(m): 10:53am On Apr 12, 2011
did u get my Sams Teach yourself C++? hope it helps
ProgrammingRe: C++/python/qt Or .net by solomon201(op): 11:25am On Apr 09, 2011
@ webdezzi
Is C++ with Qt as good as PyQt? I have a little C++ experience and really luv d language. But i hear one cant really get a job offer here in Nigeria except for .NET, PHP n few JAVA. what do u say?
EducationRe: The Most Stressful University In Nigeria by solomon201(m): 1:17pm On Apr 08, 2011
hmmmm, make una come delta stress university Abraka una go hate!!!!,
wake up very early for class getting there only to find no entrance( everywhere don full even doors n windows)
our portal is delsuonLINE.com n indeed na here people really know wetin line be.
for medical screen u line up for 5 hrs only to get this( " come back 2morrow")

Guy e many ohhh
ProgrammingC++/python/qt Or .net by solomon201(op): 1:08pm On Apr 08, 2011
Now excluding web development and license issues which is really better Qt or .NET.

Not a pro in any though so will love to hear from the guys that have used any of both of em
ComputersRe: Which Is The Best Internet Connection In Nigeria? by solomon201(m): 8:55am On Jan 29, 2011
mtnf@stlink is the fastest thus far. in asaba i get speeds of 9.6mbps to 44mbps. believe it or not. its crazy. i downloaded all episodes of supernatural season 5 (22 episodes) all about 3gb in less than an hour.
ComputersGpu Upgrade by solomon201(op): 8:37pm On Jan 26, 2011
I have a Dell Inspiron laptop but it did not come with an Nvidia Graphic chip. Is it possible to buy one and add to the laptop?
ProgrammingRe: Pls! Help With This C++ Program by solomon201(m): 11:31pm On Dec 08, 2010
@omo_to_dun
take it easy on the guy. Its obvious he is not even a programmer. I guess he is a CSC student tryin to get an assignment done. Even @ dat d guy is DULL d question is too simple. Pls guyz dnt jst give out d code it wount help him. I wonder if he can write Hello world!
ProgrammingRe: [Opinion] B.sc Computer Science In Nigeria? poo! by solomon201(m): 1:42pm On Dec 03, 2010
I am a 300L CSC student in one of our Govt owned Unis from my experience lecturers are only ood in QBASIC My first programming course was QBASIC in 200 level first semester than last semester we did C++ ( so they say) but it was very very bad the lecturer knew nothing he was using a text published in 2002. I went online got recent books and thats what I am still doing. Me I mostly believe I am just there for the paper not for the knowledge because they have little or nothing to offer.

Summary: Dnt depend of wat the lecturers say most are already obsolete there are lots of free materials online. Currently I am learning Qt from an online forum.
Technology MarketCan I Get This Specs For 75-80 K? by solomon201(op): 12:53pm On Nov 20, 2010
I need to buy a new laptop HP preferably. What specs can i get with about 75-80 K in Computer village

At least I need:

Processor: Intel core 2 duo 2.0GHz
RAM: 2GB
HD: 220 GB
Video RAM: 1 GB
screen 12-15"
webcam
bluetooth


Can I get the above specs for the price range?
If not what specs can i get
ComputersCan I Get This Specs For 75-80 K? by solomon201(op): 12:26pm On Nov 20, 2010
I need to buy a new laptop HP preferably. What specs can i get with about 75-80 K in Computer village

At least I need:

Processor: Intel core 2 duo 2.0GHz
RAM: 2GB
HD: 220 GB
Video RAM: 1 GB
screen 12-15"
webcam
bluetooth


Can I get the above specs for the price range?
If not what specs can i get
ComputersLaptop @ 75-80 K by solomon201(op): 12:07pm On Nov 20, 2010
I need to buy a new laptop HP preferably. What specs can i get with about 75-80 K in Computer village

At least I need:

Processor: Intel core 2 duo 2.0GHz
RAM: 2GB
HD: 220 GB
Video RAM: 1 GB
screen 12-15"
webcam
bluetooth


Guys I need your opinion and advise
ProgrammingRe: Which Programming Language by solomon201(m): 9:44pm On Aug 05, 2010
@beaf saying JAVA is good because it runs on all platforms is like saying "anal sex is gud because it works on both sex"
EducationRe: Who Know How 2 Upload Id Card 2 Nnpc/esso Scholasip by solomon201(m): 9:31pm On Aug 05, 2010
I hav uploaded since 4pm n till nw hav nt gotten any email notification did u guy xperience same?
EducationRe: Who Know How 2 Upload Id Card 2 Nnpc/esso Scholasip by solomon201(m): 9:27pm On Aug 05, 2010
I hav uploaded it since 4pm but till nw hav nt recieved e-mail notification. Did u guys xperience d same?
EducationRe: Who Know How 2 Upload Id Card 2 Nnpc/esso Scholasip by solomon201(m): 1:37pm On Aug 05, 2010
@ eddie n gafar afta cropin wat was d dimension n kb of ur id. Pls i wnt 2 make sure i do it right.
EducationRe: Who Know How 2 Upload Id Card 2 Nnpc/esso Scholasip by solomon201(m): 1:35pm On Aug 05, 2010
@ eddie n gafar afta cropin wat was d dimension n kb of ur id. Pls i wnt 2 make sure i do it right.
ProgrammingRe: C++ Tutorials. by solomon201(m): 6:13pm On Jun 28, 2010
Thats true there's so much out there but we something cal also start here. But so far nobody has posted anything, idea, or even raise a topic to discuss.
ProgrammingRe: C++ Assignment Help Kobojunkie, Duela, Anyone by solomon201(op): 2:36pm On Jun 24, 2010
each line contains name, score1, score2, score3;
something like this:
Mike 70 80 66
Chike 65 85 70

I want to be able to find the student who has the highest score in a certain course that is why I used a vector to hold the scores;


I think the problem is with my display function not so sure because when i removed the call to the function and compiled, the program compiled. pls take a look at it again.

Thanks
ProgrammingC++ Assignment Help Kobojunkie, Duela, Anyone by solomon201(op): 7:15am On Jun 24, 2010
I am having problems compiling this code. first I used arrays in place if vectors but the problem is still there. when i try to compile it tells me
"Linker Error undefined reference to record::record()

I am using Dev Cpp as my compiler.

Pls guys take a look at it and tell we what is wrong.



#include<iostream>
#include<vector>
#include<fstream>
#include<string>
using namespace std;


class record
{
private:
string name;
vector<int>score;
int total;
double average;

int settotal()
{
int temp=0;
for(int index=0;index<score.size();index++)
temp+=score[index];
return temp;
}

double setaverage()
{return (total/score.size());}


public:

record();

void setdata(string n, vector<int>data)
{name=n;
score.resize(data.size());
for(int k=0;k<data.size();k++)
score[k]=data[k];}


void display()
{
cout<<name<<" ";
for(int t=0;t<score.size();t++)
cout<<score[t]<<" ";
}



};

int main()
{
record people;
ifstream readfile;
readfile.open("test.txt"wink;
string tname;
vector<int>tdata;
tdata.resize(3);
readfile>>tname;
{

for(int index=0;index<tdata.size();index++)
readfile>>tdata[index];
}
people.setdata(tname,tdata);



return 0;
}



As I said earlier I have tried using arrays in place of vectors but I get the same error.
what I am trying to do is read data from a text file, compute total and average then display all the data;

Your help will greatly be appreciated.
ProgrammingRe: Android Developers Or Newbie - Lets Meet Here. by solomon201(m): 1:39pm On Jun 19, 2010
Ok, But I think symbian is more widespread especially in Nigeria here. I wonder how many Android phones are available here. How about going symbian cos its has a larger market I suppose.
ProgrammingRe: C++ Tutorials. by solomon201(m): 12:22pm On Jun 19, 2010
I am using Dev Cpp as my IDE I prefer to write my class in a different .h and then include it in the .cpp but when i do this i keep getting errors.

for example if in my class i have something like:


string name;

when i incude and compile it tells me string does not name a type,

even when i access public member functions in the class it shows class has not function named by that name.


my .cpp starts like this:

#include<string>
#include<iostream>
#include"myclass.h"
using namespace std;
int main ()
{
,



I kind of like the Dev Cpp but if there is any other good compiler let me know apart from MVC++ and Borland

1 2 3 4 5 (of 5 pages)