Follow us on Twitter!
Capitalism is an Island of wealth in a sea of poverty
Thursday, April 24, 2014
Navigation
Home
HellBoundHackers Main:
HellBoundHackers Find:
HellBoundHackers Information:
Learn
Communicate
Submit
Shop
Challenges
HellBoundHackers Exploit:
HellBoundHackers Programming:
HellBoundHackers Think:
HellBoundHackers Track:
HellBoundHackers Patch:
HellBoundHackers Other:
HellBoundHackers Need Help?
Other
Members Online
Total Online: 32
Guests Online: 26
Members Online: 6

Registered Members: 82901
Newest Member: sjs
Latest Articles
View Thread

HellBound Hackers | Computer General | Programming

Author

My C++ program


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 13-09-06 17:34
I'm making a program in C++ for my coomputer project..for Cambridge exams....

I got the feeling it pretty sucks... Anyone could give me ideas to make it better?????

"Supposed to be record oriented"


...Supposed to include array and a search function....

// 3.cpp : main project file. P2 Computing Project ...C++

#include "stdafx.h"
#include "stdlib.h"
#include "time.h"
#include <sys/types.h>
#include <sys/timeb.h>
#include <stdio.h> //Returns values to the progra fo the Date function
#include <iostream>
#include <string.h>
using namespace std;


int main()
{
//main declarations
char name[30];
char address[35];
char gender;
char team;
char project[30];
char department;
float number_project_completed;
float sales_pro;//sales made from the totality of projects
float rank;//an assignment for the renk which the person possese within the company. The smallest number representing the most important


//Declarations for time reading and displaying
char tmpbuf[128], timebuf[26], ampm[] = "AM";
time_t ltime;
struct _timeb tstruct;
struct tm today, gmt, xmas = { 0, 0, 12, 25, 11, 93 };
errno_t err;



cout<<"\n================================================================================";
cout<<" program S.P";
cout<<"\n================================================================================";

// Set time zone from TZ (Time Zone) environment variable. If TZ is not set,
// the operating system is asked to obtain the default value
// for the variable in order to find the time.
//
_tzset();

// Displaying operating system-style date and time. in this case, that of Windows XP
_strtime_s( tmpbuf, 128 );
printf( "\n time:\t\t\t\t%s\n", tmpbuf );
_strdate_s( tmpbuf, 128 );
printf( "\n date:\t\t\t\t%s\n", tmpbuf );

cout<<"\n--------------------------------------------------------------------------------";

cout<<"\n [If a statement appears several times, then you have surely made a mistake] \n";


cout << "\n Please enter name: ";
cin >> name;
cout << "\n Please enter address: ";
cin >> address;

//Start of loop aiming at restricting values for "gender"
//While loop
do

{cout<<"\n Enter gender of employee:";
cout<<"Key in M for Male and F for Female: ";
cin>>gender;


} while (gender != 'f'&& gender != 'm'Wink;

if (gender == 'm' )
cout<<"\n You entered male";
else
if (gender == 'f'Wink
cout<<"\n You entered Female";
cout << "\n ";

//Start of loop aiming at restricting values for "department"
//While loop
do

{cout<<"\n Enter Department. R: Research D: Development ";
cin>>department;

} while (department != 'd'&& department != 'r'Wink;
//Capital letters not considered by program
if (department == 'd' )
cout<<"\n You entered Development Department";
else
if (department == 'r'Wink
cout<<" \n You entered Research Department";

cout<<"\n";

// Start of loop aiming at restricting values for "team"

do {cout<<"\n Enter Team. a: Team Alpha o: Team Omega ";
cin>>team;
} while (team != 'a'&& team != 'o'Wink;

if (team == 'a' )
cout<<"\n You entered Team Alpha";
else
if (team == 'o' )
cout<<"\n You entered Team Omega";


cout<<"\n";

cout<<"\n Enter Project the person is responsible of :";
cin>>project;
cout<<"Project name is: "<<project;

cout<<"\n Enter number of projects completed by the employee: ";
cin>>number_project_completed;
cout<<"The employee has acheived "<<number_project_completed<<" projects ";


return 0;
}

Edited by on 18-09-06 07:31
Author

RE: My program


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 13-09-06 17:37
Sorry I can't help but I thought people of a high interlect get accepted into Cambridge... I saw one question but more than one question mark.

Plus don't you get a tutor you could be asking?


Author

RE: My program


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 13-09-06 17:49
I'm not at Cambridge...

Just taking part in the A Level International Exams

The person who's supposed to help me doesn't know well C++...

And I think she's constanly suffering from hormonal problems...
....no matter what shithappens to me SHE WON'T HELP......
Author

RE: My C++ program

bl4ckc4t
Member

Your avatar

Posts: 591
Location: /etc/
Joined: 07.03.06
Rank:
Wiseman
Posted on 13-09-06 18:11
It seems like it will work, I compiled it and it ran fairly smooth, I didnt notice anything wrong. The best thing is to save the source and compile.

Also, if you want to see if your doing something wrong in programming, get notepad++ it has support for pretty well all the languages and highlights syntax, and numbers lines, etc.

download it at:
http://notepad-pl. . .k/site.htm




Bl4ckC4t


Author

RE: My C++ program


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 13-09-06 18:15
Yeah..I know it works..the problem is that it is too simple and i'm not going to be awarded many marks with such a rudimentary program,...I need to upgrade it in some way.
My inspiration has run dry!!!!
Author

RE: My C++ program

knutrainer
Member



Posts: 243
Location:
Joined: 08.07.05
Rank:
Apprentice
Posted on 13-09-06 18:20
So you want to make it more complicated by doing what? Adding new functions to it or just creating a fuck job mess of the code? If its the later of the two leave your code alone.


img389.imageshack.us/img389/974/knu5ui1ja.jpg
~PM me if you need help or instant message me.


knutrainer@gmail.com
Author

RE: My C++ program


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 13-09-06 18:24
I need to be "oustanding".....

this program is so....berrrrk!!

I need to be able to save and search records...

How???
Author

RE: My C++ program


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 13-09-06 18:32
The syllabus says that the following skills should be demonstrated:
arrays and/or records
different data types [got it]
selection
iteration [got it]
procedures
functions
searching techniques
files

Author

RE: My C++ program


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 13-09-06 18:44
You should be able to use some functions in there pretty easily, returning the character strings. And as for files (assuming you mean reading from files to get the information instead of command-line), you should be able to change that without changing much of the code. Would you want to get the information from one file or several files?


Author

RE: My C++ program


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 13-09-06 19:31
only one
Author

RE: My C++ program


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 14-09-06 14:03
??????????????????????????????????
?????????anyone can help???????????
?????????????????????????????
Author

RE: My C++ program

lukem_95
Member

Your avatar

Posts: 232
Location: 127.0.0.1:80
Joined: 05.07.06
Rank:
Apprentice
Warn Level: 5
Posted on 14-09-06 17:22
no offence but for a Cambridge level program, thats not the best, im a 14 year old kid ( and funnily enough live in Cambridge Pfft ) and that program isnt really inspiring lol, i could write better, maybe you should try something more interesting than simple cin and cout stuff (althought all the dates etc is pretty cool, i havnt seen that before).


www.hellboundhackers.org/news.php?logout=yes
Author

RE: My C++ program

lukem_95
Member

Your avatar

Posts: 232
Location: 127.0.0.1:80
Joined: 05.07.06
Rank:
Apprentice
Warn Level: 5
Posted on 14-09-06 17:23
no offence but for a Cambridge level program, thats not the best, im a 14 year old kid ( and funnily enough live in Cambridge Pfft ) and that program isnt really inspiring lol, i could write better, maybe you should try something more interesting than simple cin and cout stuff (althought all the dates etc is pretty cool, i havnt seen that before).


www.hellboundhackers.org/news.php?logout=yes
Author

RE: My C++ program


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 15-09-06 07:26
If you think you can make it better, feel free to do so...

pm me if you got any ideas..or post it here..
Author

RE: My C++ program


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 18-09-06 08:58
Anyone??
Please!!
No one really competent on this site???????????
Author

RE: My C++ program


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 18-09-06 10:39
People have helped you as much as they can. I haven't seen on post of appreciation.

Either start something more constructive or go elsewhere.

If you continue to duplicate posts then this thread will be locked.