C++/ask!

Advertisement


Question
QUESTION: here's what i need:

Create a program that uses typedef implementation of two salary arrays. The first salary array will get its input from the user, and then store the salary increase by 8% in the second array. Output the salary and the salary increase.


please help me! XD

ANSWER: Typedef keyword is used to give some other name to a type. For example,

typedef int Apples;
typedef int Oranges;
Apples coxes;
Oranges jaffa;

(copied from http://en.wikipedia.org/wiki/Typedef )
You have to use typedef implementation-defined arrays. So you can do

const int SIZE = 1024; // some large number
typedef int InputType[SIZE];
typedef int SalaryIncType[SIZE];

For examples how to use arrays in C++, see examples at http://www.fredosaurus.com/notes-cpp/arrayptr/array-examples.html

Going back to basic things, you will need an IDE to start coding. IDE - Integrated Development Environment (see http://en.wikipedia.org/wiki/Integrated_development_environment). The IDEs Turbo C++ and Visual Studio are popular among starters.  

Hope this helps! Get back to me if you're stuck somewhere.

---------- FOLLOW-UP ----------

QUESTION: i cant really understand it.. can you plese elaborate more? specify more examples..
ANSWER: What exactly do you don't understand? Please provide more details so I can answer.

---------- FOLLOW-UP ----------

QUESTION: uhmm.. i have already provided the problem that was given to us..

Create a program that uses typedef implementation of two salary arrays. The first salary array will get its input from the user, /*for example, 1200 1500 2000 2400*/ and then store the salary increase of 8% in the second array. Output the salary and the salary increase. /*the printf will contain the salary inputted by the user, and adjacent to that will be the result of its 8% increase..*/

got it? =p


Answer
The problem given to you is for you to solve. I can help you out if you get stuck in the way - but you can't just pass the buck back and forth. I still have no idea whether you made any effort in understanding my previous answer and which part of my answer did you not understand. I hope you can communicate it to me.

C++

All Answers


Answers by Expert:


Ask Experts

Volunteer


Amit Kumar

Expertise

I can answer Cplusplus language and library questions, including STL, ACE, Boost. I have a good background in Mathematics.

Experience

Programming in CPP for about 8 years. Industry experience of 4 years.

Education/Credentials
Bachelors and Masters in Computer Science from Indian Institute of Technology Delhi.

©2016 About.com. All rights reserved.