my project

Pages: 12
hi how are you all
that my project in my unversty can any one help me ^_^

Project Title:
Company System Program

Consider a company system which has a menu offers the following options:
1. Add new employee.
2. Update a department sales.
3. Show the sum of sales for a week in all department.
4. Show the average of sales for a departments in a month
5. Print the departments' information.
6. Exit.



a)If option 1 is chosen, the main function passes one-dimensional array named employeeNames and one-dimensional arrays named departments to a function ADD. This function prompts the user for a new employee's information (name, department) and add them to these two arrays:

a.eployeeNames array: is a one-dimensional array with one columns which stores the name and a maximum of 100 rows (employee) where each row stores a single employee.

b.department array: is a one-dimensional array a maximum of 100 employee which stores the employee's department.
The function will return TRUE if the employee is added successfully, FALSE otherwise , then the main will print the new arrays.

b)If option 2 is chosen, the main function prompts the user to enter the department number (DN) and the week (W)to be updated. Then it passes DN , W and ONE two-dimensional array named sales to a function UPDATE. This function will search for the department and the week, prompt the user for a new sale and then updates Department's information.
The function will return TRUE if the department is updated successfully, FALSE otherwise .


c)If option 3 is chosen, the program should ask the user to specify which week he's interested in by displaying the following message:

"Choose a week to compute its sales for all departments: (Press 1 for week 1, Press 2 for week 2, Press 3 for week 3, Press 4 for week 4)"


d)If option 4 is chosen, the program should ask the user to specify which department he's interested in computing its average by displaying the following message:
"Choose a week compute the average of sales of a department in a month: (Press 1 for Dep 1, Press 2 for Dep 2, Press 3 for Dep 3)"


e)If option 5 is chosen, the main function passes the sales array to a function PRINT. This function prints all the information for each department in the company. (BONOUS)

f)If option 6 is chosen, the main function stops immediately.

The Arrays:
employeenames
0
0 Ahmad
1 Nasser
2 Khaled
3 Fahad
department
0
0 1
1 2
2 3
3 1

Sales:
Dep/Week Week 1 Week 2 Week 3 Week 4
Department 1 12000 13500 10000 14000
Department 2 34600 20000 18700 21400
Department 3 16500 11670 14320 17500

thankes for ALL i wish any one can help me thankes

Last edited on
mmmmm plz help me meby only one part


a)If option 1 is chosen, the main function passes one-dimensional array named employeeNames and one-dimensional arrays named departments to a function ADD. This function prompts the user for a new employee's information (name, department) and add them to these two arrays:

a.eployeeNames array: is a one-dimensional array with one columns which stores the name and a maximum of 100 rows (employee) where each row stores a single employee.

b.department array: is a one-dimensional array a maximum of 100 employee which stores the employee's department.
The function will return TRUE if the employee is added successfully, FALSE otherwise , then the main will print the new arrays.
Last edited on
It's not a good idea to just continue posting project assignments on this forum and expect people to code parts of it for you.

We are all happy to help, but try coding part of it yourself first then you can ask for advise. It will be much more worth while in the long run.
James2250 and Prashant Gupta PG
thankes cuz suport me but you know that my h.w the c ++ very defucalt and im here i try that and i wont to learn more in the c++ i hope only how will be start thankes for any thing
plz any one help me about my project i cant solve that proplem im craying *_*
A few steps :

1- First, create a menu (6 options) (You may use cout or printf)
Input the user choice.
2- Then next, Add new employee.
Create two arrays. An example :
1
2
3
4
5
6
7
8
9
10
11
12
13
char employeeNames[100][100];
char departments[100][100];

int size = 0;
bool Add(char *name, char * depart)
{
if(size == 100)return false;// Full
strcpy(employeeNames[size], name); 
strcpy(departments[size], depart);
size = size + 1; //Next employee 
return true;
}


3- Update a department sales.
prompts the user to enter the department number (DN) and the week (W)to be updated. Then it passes DN , W and ONE two-dimensional array named sales to a function UPDATE.

Create new variables, and use the input functions.

This function will search for the department and the week, prompt the user for a new sale and then updates Department's information.
The function will return TRUE if the department is updated successfully, FALSE otherwise .

...This may require more information.


First of all, you have to do the step one and step two... And, we'd like to see your progress... :)
Last edited on
@JM

Here we go again, you are offering advice, when you really don't know what you are doing.Lines 1 & 2 in your code snippet are classic examples, and you are doing C code again because you don't know C++.

I don't see your behaviour changing, and that is the second time today.
@TheIdeasMan
Can you tell me the difference between C and C++?
And :
char employeeNames[100][100];
char departments[100][100];

int size = 0;
bool Add(char *name, char * depart)
{
if(size == 100)return false; // full
strcpy(employeeNames[size], name);
strcpy(departments[size], depart);
size = size + 1; //Next employee
return true;
}

Can you rewrite it (C++)?
Thanks you.
Last edited on
@JM

I have said to you in the past, what the differences between C & C++ are. I have no need to justify my C++ coding skills to you.

Again, all your posts seem to be made to provoke comment, and as I have said right from the start, are troll like behaviour. You disagree? - then change your behaviour.
closed account (D80DSL3A)
@TheIdeasMan:
You are the one trolling here.

This requirement:

a.eployeeNames array: is a one-dimensional array with one columns which stores the name and a maximum of 100 rows (employee) where each row stores a single employee.

While cryptic, seems to hint that the columns are for each name and then there are 100 rows.
I see c style character arrays being (possibly) required to be used here.
If this is so then JM is dead on with her approach.

OP hasn't really given us enough to know.

We get a wide variety of people here. Try to be more tolerant.
If you disagree with a post, offer a counterexample.
Last edited on
@fun2code

First, JM edited the post, originally it had char employeeNames[100]

Have you seen all the crap code posted by JM in the past? There are a number of senior experienced members of this forum who agree with me on this point. I picked JM as being a troll right at the start - so I am past being tolerant. More likely, I am regretting not going in harder, earlier.

As for posting code, I am past that as well. In this case, I am not going to waste my time for the sake of a troll.

There has been a lot of advice given to JM, by various people, but the behaviour has not changed.

And If anyone thinks I am trolling, then look at the vast bulk of my 1500 posts, and you will see they are about helping people.

If I am outspoken about this, then it is because of concern for the quality of this forum.

closed account (3hM2Nwbp)
@TheIdeasMan

It's hard to distinguish between trolls and those unfortunate enough to have taken a college level C++ course. Colleges don't teach current C++. Colleges teach C++ from the long lost past. In 2011 (or 2010? I can't recall exactly), I took a C++ course when I was finishing my AAS in automotive tech, and the instructor wouldn't accept what I was turning in because:

A) It didn't compile with the college's archaic version of GCC
B) He didn't understand it.
C) None of the other student's code looked like it.

Therefore, I blame the education system for this conundrum.

@Jackson Marie -- "Modern" C++ approach
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/// Likely that a professor would not accept this from a student...
#include <list>
#include <string>
#include <tuple>


std::list<std::tuple<std::string, std::string>> employees;

void add(const std::string& name, const std::string& department)
{
    employees.push_back(std::make_tuple(name, department));
}

int main()
{
    add("1", "first dept.");
    add("2", "second dept.");
}
Last edited on
@Luc Lieber

It's hard to distinguish between trolls and those unfortunate enough to have taken a college level C++ course


But JM's code is much worse than that. It is more like C with a few basic C++ things like cout. Even then it is really bad with goto, infinite loops used badly, shocking formatting, global variables, the list goes on ....

Senior experienced members of this forum have refused to analyse JM's code because it is too much of a mind F***

JM doesn't write C++ code, because there is no understanding of it, in fact JM can't write C code properly.

Even if JM is badly self taught in C, there is no change in behaviour, or any attempt to learn, despite lots of advice from senior members. And yet, JM continues to offer bad advice to newbies. See my concern now?
closed account (3hM2Nwbp)
But JM's code is much worse than that.


If you had only seen the disturbing scenes that I have...*shudder* I still wake up in a cold sweat some nights. :P

I see your concern, but it's very possible that this person is simply doing what they've been taught and repeating the deadly vicious cycle.
Last edited on
@LL

So that's what I am trying to do - stop this crap from propagating.
closed account (D80DSL3A)
@theIdeasMan

I still think you're in the wrong.

I'm speaking up because what I have been seeing is a sequence of unprovoked attacks on her by you in numerous threads.
You attack in a personal and insulting manner, which has no place in a civilized forum.

NO ONE else does this.

The battle you are having with her in public on these forums is becoming a tiresome spectacle.
That is my point.
y all this fracas.
i think it will benefit everyone if can spend our energy helping others rather than fighting one another. that's what the forum is for after all.

@Luc Leiber, your code is quite advanced to me. I use a txtbook written in 2007, do you think it is outdated? If you think so, can you please tell me another alternative, i really want to advance in this language.
@fun2code

Oh well you help JM then, see how long it is before you are fed up with it. My comments are not unprovoked.

Edit: And you can be the one to advise against all the bad code presented to newbies.

NO ONE else does this.


Not true, some senior members have written serious criticism.
Last edited on
:@theIdeasMan

Right, actually my programming is bad, bad, and very bad (see user profile). I haven't programmed for years... So, This is C++ forum, so in my opinion, trying the low-level C++ code (C code) certainly is really bad, right @theIdeasMan ? Does that mean I should get rid of all ancient C experience skill and then start learning C++ again from scratch?

Today I've learnt something from the modern code example... (^_^)
Pages: 12