C/C++ :: Build A Sales Company Class?

Jul 1, 2014

Build a class named "salesCompany". Save it's name with a string and an array with records which will be filled with values from sales in different cities of the company.

Build the constructor which must get as a parameter the name of the company and a text file which will fill the array. There is an example of the text file format. Every line saves the sold quantity of a product, identified by a code, in a certain city.

CodeCityQuantity
1a63bCity11200
45ab8City2550
#include <iostream>
#include <string.h>
using namespace std;
class salesCompany {

[code].....

what should I add more and how can make it available for the user to enter as an input a text file.

View 1 Replies


ADVERTISEMENT

C/C++ :: Build Error When Trying To Include Another Custom Class?

Mar 15, 2015

I have a class like this:

#include <string>
using namespace std;
//-----------------------------------------------
class Prenumeratorius {
private:
string pavarde;
string adresas;
string leidinioKodas;

[code]....

bunch of variables, constructor, setter and getter.And I have this class:

#include <vector>
class Leidinys {
private:
string kodas;
string pavadinimas;
double vienetoKaina;

[code]....

in to my "Leidinys.h" header file, I get a build error, I tried to remove same includes in both files, that didn't worked.

View 3 Replies View Related

C++ :: Build A Banking Simulation Program Around The BankAcct Class?

Sep 5, 2014

I'm supposed to build a banking simulation program around the BankAcct class, which provides the following service: create new account with unique account number (maximum 5 accounts created in a single test running); deposit/withdraw; print information of all existing account. I was running a test program with only 2 services first, namely creating new account and depositing, but the program just keep on crashing and I couldn't figure out why.

#include <iostream>
#include <sstream>
#include <string>
using namespace std;

[Code].....

View 1 Replies View Related

C++ :: Array Sales Bar Chart?

Dec 17, 2012

I need to make a bar chart with asterisks that looks like this:

Store 1: ******
Store 2: ***
etc.

anyway, right now what I have is:

Code:
#include <iostream>
#include <iomanip>
using namespace std;
int main () {
const int STORES = 5;
int sales[STORES], i;
for (i = 0; i < STORES; i++) {

[code].....

It's not displaying asterisks.

View 1 Replies View Related

C++ :: Corporate Data Sales Structure

Nov 20, 2013

Corporate Data Sales

Write a program that uses a structure named CorpData to store the following information on a company division.

Division Name(North, South, East, Or West)
First quarter sales
Second quarter sales
Third quarter sales
Fourth quarter sales
Total annual sales
Average quarter sales

Include a constructor that allows the division name and four quarterly sales amounts to be specified at the time a CorpData variable is created.

The program should create four variables of this structure, each representing one of the following corporate divisions: North, South, East and West. Each variable should be passed in turn to a function that calculates and stores the total annual sales and average sales for that division.

Once this has been done for each division, each variable should be passed in turn to a function that displays the division name, total sales, and average sales.

Here is my code:

#include "stdafx.h"
#include <iostream>
#include <string>
using namespace std;
struct CorpData {

[Code] ....

View 1 Replies View Related

C/C++ :: Quarterly Sales Program Using 2D Arrays?

Mar 6, 2014

I wrote this program using struct and it works fine, now I want to write it just using arrays and I don't think i can do it. So here is the original code:

#include <iostream>
#include <string>
#include <fstream>
#include <ctime>
#include <cstdlib>
using namespace std;
//function declarations
void init()

[code].....

View 2 Replies View Related

C# :: Displaying Multiple Images And Adding Sales To Them?

Aug 28, 2014

My application requires the user to add sales to images, this is done by displaying the image for the GUI, and then the user would add sales using that images ID which is brought in from the database.

In part this is 2 questions, first question is what is the best way to generate a List for use when adding the sales to the database. The List would need multiple strings for each sale. So for example:

Image 1 (Sale)

- JPG ID
- Product ID
- Product Quantity

So i'm going to assume i'm best creating a new instance of a custom class for each sale, and then add each instance to a List<Sale>?

public class Sale
{
public int SaleID { get; set; }
public int JpgID { get; set; }
public int SaleQty { get; set; }
}

Then I need a decent way to update this List with the GUI controls. So maybe get the JPG ID and set name of the Sale Class Instance to the ID, in this way its unique and I can update that instance when it comes to increasing the sale of a product or decreasing it.

Second part comes to the design of the GUI of adding sales, when I made this using HTML/PHP that was easier. It looked something like this:

If I wrote some code to generate that kind of design again in C# it going to require many Controls, wouldn't that be a bit intensive on the system? I just want something which looks great but also functions good.

At some point I'm going to switch to WPF, but I just need to get a working prototype working now which my client can use, and then update it when I have more time as I have got other Web Related projects that need doing, so at the moment WPF is out of the question.

View 2 Replies View Related

Visual C++ :: Program To Calculate Sales Totals For A General Store - While Loops

Jan 25, 2013

I need coding this project using while loops and cout/cin.. It is suppose to be one while loop for the whole thing and inside of the first while loop is the second while loop for each sale separately.

You have been asked to write a program to calculate sales totals for a general store. Your program will not know how many products each customer will buy, so your program will have to repeat the process until the last product has been entered (use -1 for Product ID to end each sale). After each sale your program must ask if you want to do another sale (Y - continue, N - end program).

At the beginning of the day, the cash drawer has $500 in it. At the end of the program you must display how much money is in the drawer after handling all your sales transactions.

Input
Your program must take the following input:
- Product ID Number (int)
- Quantity for each item purchased (int)
- Cash Received at the end of the sale

Use the following dataset to determine the price and taxability for each item.

First Sale:
Product ID Price Quantity Taxable
101 $65.00 2 Yes
102 $12.50 1 No
103 $24.50 5 No
104 $38.75 4 Yes
105 $17.80 6 Yes
106 $16.50 2 No
107 $42.85 8 Yes
108 $32.99 2 Yes
109 $28.75 1 Yes
110 $51.55 1 No

Second Sale:
Product ID Price Quantity Taxable
102 $12.50 1 No
103 $24.50 1 No
106 $16.50 1 No
107 $42.85 1 Yes
108 $32.99 1 Yes
109 $28.75 1 Yes

Third Sale:
Product ID Price Quantity Taxable
106 $16.50 4 No
107 $42.85 3 Yes
108 $32.99 1 Yes
109 $28.75 5 Yes
110 $51.55 2 No

Calculating Tax
For those items that are taxable, assume a 7.5% sales tax. Be sure to keep a running total of tax for the each sale.

Getting Started
You must use the starter file provided with this assignment.
What to turn in:
- A copy of your source code
- A printout of your program's output

View 2 Replies View Related

C++ :: Payroll Program Of A Company That Have At Least 5 Employees

Oct 1, 2014

Make a c++ program of the payroll of a company

input values :
a. Name of Employee
b. Position in the company
c. No. of hours worked
d. No. of overtime hours
e. rate per hour

formula:
basic pay = number of hours worked x rate per hour
ot pay = overtime hours x 150% of rate per hour
gross pay = basic pay + ot pay
tot deduc = tax + sss + med

tax can be computed based on the following table:
basic pay tax
10000 or less 1% of basic pay
10001-15000 2% of basic pay
15001-20000 3% of basic pay
20001-30000 4% of basic pay
30001 or more 5% of basic pay

sss = 10% of basic pay
med = 6% of basic pay

net pay= gross pay - total ded

*The payroll should have at least 5 employees in it.*

View 11 Replies View Related

C++ :: Cab Company Program / Endless Loop?

Jan 14, 2015

I'm trying to get this program to return total taxi cab fair an infinite number of times, however, when I use the while statement after for and try to run the program, it just keeps displaying the first total fair rapidly.

specifications:A cab company needs a program to calculate the cost of a cab ride.

The driver will enter the length of the trip in miles.

The miles entered must be greater than 0.

Create a function to calculate the charge. The function should receive one argument, the length of the trip, and should return the total fare for the ride.

The taxi charges a fixed charge of $2.50, plus an additional charge of $1.85 per mile.

Allow the user to calculate any number of trips.

At the end display the total of all the fares.

here is my code:

#include <iostream>
#include <iomanip>
using namespace std;
//function prototypes
double getLength ();
int main () {

[code]....

View 3 Replies View Related

C :: Obtain Check Number And Then Company Information From Datafile

May 13, 2013

I have to obtain a check number from a datafile and then also get company information also from a datafile.

So my first question is about the:

Code:
char outputFilename[]= "out.list"

Is this the name of the output file I'm going to write to? And also the file has to be created before being used...is that line of code creating the file or do i have to create it in notepad?

Code:
FILE *ifp, *ofp;
char *mode = "r";
char outputFilename[] = "out.list";
ifp = fopen("in.list", mode);
if (ifp == NULL) {
fprintf(stderr, "Can't open input file in.list!

[Code] .....

View 7 Replies View Related

C :: Create List With Employees Of Company Using Binary Trees

Dec 5, 2013

My colleague and I have been given a task to create a list with the employes of a company using binary trees. Each employee/node has to contain the following information:

- Employe name
- Rank
- ID Number
- monthly Salary

We have to write a C program (using Codeblocks) which builds the company tree with the information above and afterwards lists all the employes who have a salary bigger then a number specified by the user.

So far so good. We've had a look on the examples on the internet and after finding one which looked friendly enough we started working on that one to suit our needs. Credits for the original source code to: C Program to Implement Binary Search Tree Traversal - Basic C Programs | C Programming Examples

We've reached the point where we're able to insert the required information but being able to list all the employes who's salary is bigger then the number given by the user seems to be rather difficult to achieve. I'll include the code next. We have left almost the entire pieces of the original code and we are aware that the are still things which are not required for our assignment, which only requires to enter the 4 information above and afterwards display the employes with the before mentioned condition concerning their salary.

Code:
# include <stdio.h>
# include <conio.h>
# include <stdlib.h>
typedef struct BST

[Code] .....

View 1 Replies View Related

C++ :: Calculate Area For 500 Different Measurements For Playground Company In Region

Feb 13, 2014

You are writing a program to calculate the area for 500 different measurements for a playground company in the region. The company must calculate square footage of each prospective playground, as well as the total cost to mulch each area. The cost of mulch changes frequently, so the company would like to be able to input the current cost per square foot of mulch each time they run the program. Since the quantity of data is large, the input should come from a file called “measurements.txt”. You can assume the file includes the length of each prospective playground, followed by the width. The file will be in the following format.

450300
120210
.
.
.

Ask the user the name of the file they would like to write to, as well as the current price of mulch per square foot. Output the area of each playground, along with the total price of mulch to the file that the user specifies. The playground company would like each column of output to be 20 characters in width. Each column should have an appropriate heading in the output file. You should format your output data appropriately. For example, for the input data displayed above, along with a $2.00 per square foot mulch price, the output would be:

Area Total Mulch Price
135000 $270000.00
25200 $50400.00

View 3 Replies View Related

C++ :: Program To Calculate Company Weekly Payroll - Calling Functions?

Jun 9, 2014

This program in not completed. I am creating a large program in order to calculate a company's weekly payroll. For now I am filling in the separate functions piece by piece before the rest of the program is completed.

Right now I am trying to use separate functions to call other functions. I need to ask the user for the file name and then open the file. I am no longer getting any compiler errors however when I run the program all it displays is "Welcome."

So it's not actually calling the NameTheFile function and the OpenTheFile function. It just says "Welcome" and then closes down. Why is it doing this?

/*Program to determine company's weekly payroll*/

#include <iostream>
#include <string>
#include <fstream>
using namespace std;
void NametheFile() {

ifstream inputFile;

[Code] ....

View 1 Replies View Related

C++ :: Program For Used Car Dealer Company To Maintain Cars Inventory And Details

Aug 25, 2014

You are required to write a program for a Used Car Dealer company. In the system you need to maintain the cars’ inventory and details. Each car in the company contains the following details:

• Car Registration Number
• Car Make or Brand
• Car Model
• Car Colour (eg. Silver, Black , Red)
• Year of manufacturing (The year the car was manufacture)
• Engine Capacity (in cc)
• Transmission (manual or automatic)
• Cost of the car (SGD)

The Car Registration Number is in the format of AAA1234 or AA1234A or A1234A which is accordance to the Malaysia car registration format. The A alphabet is in accordance to the registration number for respective in Singapore. (eg. AEW9829 or W1212Y or MCD1177). Note the A and the 1234 total count in the registration number can be less than 3 like AT9829 or BHY280. The Car Make is for the identifying the manufacturer of the car like Honda, Toyota, Proton..etc. The Car Model is to represent the Manufacturers’ respective model like Honda City, Honda Civic, Honda Accord, Toyota Vios, Toyota Camry … etc.

You are required to create menu and operations for:

1) Create a new Car account
2) Edit existing Car account details
3) Remove a car account from the system
4) Search for cars in the system (based on Car Make, Model, Year of manufacturing or Price)
5) Check total inventory in the system

View 1 Replies View Related

C++ :: Painting Company - Calculate Amount Of Paint Required For Every Contract

Dec 15, 2014

You work for a painting company. Your job is to calculate the amount of paint needed for every contract assigned to the company. This time, you need to paint an outside wall. The dimensions of the wall are 5 X 7m. The window is a circle with the radius of 1m. Write a program that would calculate the following:

The amount of paint needed knowing that you need 1 gallon per 10 square meters. The amount of time to complete the job knowing that it takes 1 hour per 10 square meters to prepare the surface, 5 minute per square meter to pant it and 5 minute per square meter to clean up the area.

View 8 Replies View Related

C++ :: Functions Without Parameters - Compute And Print Total Number Of Products For Company

Mar 27, 2013

Summary: 6 companies have a product in 5 different warehouses. Each company is identified by a positive ID number and each warehouse is identified by a number (1 for the first, 2 for the second,…)

Object: the object of this assignment is to write a C++ program which asks the user to enter a company ID number, and the number of products in each of the warehouses. It then computes and prints the total number of products for that company

If the total number of product is less than 100, it prints the message “place a new order”

Input: for each company, its ID, and the number of products in each warehouse with appropriate prompt messages.
Example: Enter company ID number: 101
Enter number of products in warehouse #1:30
Enter number of products in warehouse #2:60
Enter number of products in warehouse #3:0
Enter number of products in warehouse #4:5
Enter number of products in warehouse #5:27
The total for company 101 is:122

Output: for each company, the total number of product, and the message “place a new order” if the total number of product is less than 100.

Method:
1. Define global variable, int total_prod to hold the total number of products for a company
2. define the function void compute_total() that uses a loop to read the number of the products in all warehouses for one company, computer the total number of products and store it into the global variable total_prod.
3. Define the function void new_order() that determines if a new order need to be placed as follows: if the total number of products (in the global variable total_prod) is less than 100, it prints the message “place a new order”
4. Your function main does the following in a loop:
- read a company ID number
- call function compute_total() to read the number of the product in all warehouses for that company, and to compute their sum
- print the total number of the product for that company with an appropriate message
- call the function new_order() to determine if a new order need to be placed.

View 17 Replies View Related

C++ :: How To Build A Custom Allocator

Feb 7, 2014

I'm trying to write a custom allocator that I can use with the STL. Here's what I have so far :

Code:
#include <cstddef>
#include <iostream>
#include <memory>
#include <vector>
template<class T>
struct customallocator {

[Code].....

I'm doing and currently, my push_back doesn't seem to do anything.

View 12 Replies View Related

C++ :: Build Own Library (static)

Sep 11, 2014

How to build the static library on my own using visual C++ 2008.

I used the following code to create the header file and cpp of the library.but I am unable to compile due to the following error.

// MathFuncsLib.h
namespace MathFuncs {
class MyMathFuncs {
public:
// Returns a + b
static double Add(double a, double b);

[Code] .....

Error I get while it is compiled :
Error3error C2653: 'MyMathFuncs' : is not a class or namespace name

View 4 Replies View Related

C++ :: Build Events Like Another Languages?

Sep 28, 2013

class test {
private:
string name="";
public:
event void changedname();
void setname(string value)

[code]....

i get error about 'a' and 'b' not be a class. but using a template can i validate these code?

my problem is that i don't know how to use objects outside of functions / these is polymorphism, but not accepted by C++

View 12 Replies View Related

C/C++ :: How To Build Array In A Function

Apr 6, 2014

I need to build an array in a function and return that array. Well, two arrays actually, which means I can't return it in the return statement.

Long term, this function/method is supposed to return two populated buffers for further processing. The buffers/arrays are loaded from a file. So, the size of the array is completely unknown until after the file is read. So, you can't have a fixed size array until the function is almost ready to return.

I'm hardcoding the arrays here for testing purposes, but eventually they will be loaded in from a file. That's the whole purpose of this.

Anyway, I need to pass the arrays that are created in this function/method to the caller. But I can't figure out how to do it. The code "almost" works, except that it's overwriting my array when it returns.

Here's the method:

bool GameModelClass::LoadBuffersFromPUNCFile(std::wstring PUNCFileName, VERTEX* &VertexListPointer, unsigned int* &IndexListPointer) {
VERTEX GroundVertexList[4] = {

[Code]....

VertexListPointer returns the correct data structure (actually its an array of structures). The problem is that the first time I use the other variables it over rights the array. The pointer still points to the same spot, but VertexBufferDescription is next to the VertexListPointer and so completely overwrites it.

What I "think" I want is to allocate the array in a totally different area of memory. VertexListPointer should be a pointer, not a contiguous block of memory. It should point to the contiguous block of memory elsewhere.

This is where my weak understanding of pointers comes back to bite me in the posterior end.

In the end, I just want to pass back two arrays/buffers to be used by the calling code.

View 14 Replies View Related

C++ :: How To Build Binary Tree With Values

Dec 29, 2013

I am not sure how to build the tree with values:

Code:
struct Node *root = 1 root->left = 2
root->right = 3
root->left->left = 4;
root->left->right = 5;

Everything should be right except the main(). How to demonstrate this program correctly?

Code:
#include <iostream>
#include<stdio.h>
#include<stdlib.h>
#include <stack> // std::stack

[Code] .....

View 8 Replies View Related

C++ :: Build Min Heap With No Repeating Values

Jul 10, 2013

10,11,20,1512,22,24,19,22

i want to write a c++ program to build min heap which gets above values from user. remember this program should not alloduplicate values to enter. it should discard duplicate values.

View 11 Replies View Related

C++ :: How To Build SMTP Mail Client

Jul 18, 2013

i have four email adresses (for various reasons) and i could probably find a client for all three on source forge, but i thought it would be good practice to use my own. i want to use boost, sdl, and c++, but i cant find a tutorial.

View 2 Replies View Related

C++ :: Build Application That Queries The Database?

Sep 27, 2013

I have lot of C++ API exposed in our project and I want to build an application that queries the database and shows some stuff to the user in the UI.

So, essentially, my main code is in the c++ language. What choices do I have over the UI?. I am interested in showing this UI in the form of a html page lilstening to a port.

View 1 Replies View Related

Visual C++ :: Functions Were Discarded On Build Of DLL With 8.0

Dec 9, 2012

I want to build a dll library with visual c++ 8.0 and got an "unresolved symbol" linker error message when trying to use the library with an application. So I checked the dll library with dependency walker for the exported functions, the needed functions were missing in the library.

I then dumped the corresponding object file with dumpbin.exe, the function was declared as public, like the other exported functions. On the next step, I set the verbose switch for link.exe.

The verbose log told me, that the function was discarded on the linker run. What can lead to that behaviour of the visual c++ linker ?

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved