Simple program to copy one file to another.

Create a simple program to copy one file to another.
Your program should do the following:

(a) Accept two command line parameters — the source and destination filenames — checking whether they are correctly specified.
(b) Open the source file for reading, and the destination file for writing.
(c) Check that they both opened correctly, and report an error if appropriate.
(d) Read the source file character-by-character, and write each character to the destination file.
(e) Stop when the end of the source file is reached.
 

Note: The final read operation will fail — that's when you detect the end of the file. Make sure not to write an extra bogus character to the destination file.

(f) Close both files when complete.

Solved
Programming in C,C++ 1 Answer Anonymous(s) Post

SQL error 1265 data truncated for column issue.

I have a table in MySQL table looks like

create table Pickup
(
PickupID int not null,
ClientID int not null,
PickupDate date not null,
PickupProxy  varchar (40) ,
PickupHispanic bit default 0,
EthnCode varchar(2),
CategCode varchar (2) not null,
AgencyID int(3) not null,

Primary Key (PickupID),
FOREIGN KEY (CategCode) REFERENCES Category(CategCode),
FOREIGN KEY (AgencyID) REFERENCES Agency(AgencyID),
FOREIGN KEY (ClientID) REFERENCES Clients (ClientID),
FOREIGN KEY (EthnCode) REFERENCES Ethnicity (EthnCode)
);

sample data from my txt file 
1065535,7709,1/1/2006,,0,,SR,6
1065536,7198,1/1/2006,,0,,SR,7
1065537,11641,1/1/2006,,0,W,SR,24
1065538,9805,1/1/2006,,0,N,SR,17
1065539,7709,2/1/2006,,0,,SR,6
1065540,7198,2/1/2006,,0,,SR,7
1065541,11641,2/1/2006,,0,W,SR,24

when I am trying to submit it by using

LOAD DATA INFILE 'Pickup_withoutproxy2.txt' INTO TABLE pickup;

it throws error

Error Code: 1265. Data truncated for column 'PickupID' at row 1

I am using MySQL 5.2

Solved
Automata or Computation 4 Answer Anonymous(m) Post

What is the best way for a beginner to learn HTML/CSS?

HTML and CSS are very easy to learn and the best way to learn is to build small projects. Before starting the project there are few guidelines you should be aware of and must be followed while writing code.

Solved
Database Management System 1 Answer Anonymous(s) Post

find a winner among n > 0 contestants by a game of elimination.

Consider a prize to be awarded to a winner among n > 0 contestants by a game of elimination. The n contestants first line up in a line and are assigned the numbers 1 to n one by one.

The host of the game then decides on an integer k > 1 and starting from contestant 1, the host counts k contestants down the line and eliminates the kth contestants from the circle. He then continues to count for another k contestants and eliminates the kth contestants from the line. When he counts to the end of the line, he will continue counting from the beginning of the line. This process repeats until there are only one contestant remains who will be the winner of the prize.

For example, if n = 7 and k = 3,
The initial line: 1234567, count to 3 and contestant 3 is eliminated
The line now becomes: 124567, continue counting from 4 and contestant 6 is eliminated
The line now becomes: 12457, continue counting from 7 and contestant 2 is eliminated
The line now becomes 1457, continue counting from 4 and contestant 7 is eliminated
The line now becomes 145, continue counting from 1 and contestant 5 is eliminated
The line now becomes 14, continue counting from 1 and contestant 1 is eliminated
The winner is contestant 4

Solved
Programming in C,C++ 1 Answer Anonymous(s) Post

find a suitor among n > 0 contestants by a game of elimination.

In an ancient land, the beautiful princess Eve had many suitors. She decided on the following procedure to determine which suitor she would marry. First, all of the suitors would be lined up one after the other and assigned numbers. The first suitor would be number 1, the second number 2, and so on up to the last suitor, number n. Starting at the first suitor, she would then count three suitors down the line (because of the three letters in her name) and the third suitor would be eliminated from winning her hand and removed from the line. Eve would then continue, counting three more suitors, and eliminating every third suitor. When she reached the end of the line, she would continue counting from the beginning. For example, if there were six suitors, then the elimination process would proceed as follows:



Write a program that creates a circular linked list of nodes to determine which position you should stand in to marry the princess if there are n suitors. Your program should simulate the elimination process by deleting the node that corresponds to the suitor that is eliminated for each step in the process. Be careful that you do not leave any memory leaks.

Solved
Programming in C,C++ 1 Answer Anonymous(s) Post

Draw the class diagram.

Draw the class diagram, showing all attributes, functions, and cardinalities for the below case study:

Invoicing

When an order is made, the employee input the details regarding the destination, order amount, and customer details into the system which then processes the order. An invoice is generated with the details input. The time, date, and destination of the delivery are also printed on the invoice.


Accounting

This business process deals with all financial transactions in the organization. It keeps track of sale invoices, the salary of employees, and purchase cost. Each transaction is recorded and monthly financial reconciliation is made to keep track of the company's expenditures.


Logistics

The eggs are maintained at optimal temperatures. Once they are ready to be sold and transported to the customer, they are packed, branded with the expiry date, and are then transported in vehicles to the respective delivery destination. The stock level is depleted accordingly. The feeding process is also controlled by some specific conditions.


Product delivery

Employees have to inform the drivers about the product delivery destination via text messages. The latter has a time delay to respect in order to maintain good customer service and that the product reaches the destination in good condition. As soon as the product is delivered, a notification is sent to the employee who processed the order who then informs the customer of successful delivery.

Solved
ER-Modeling 1 Answer Anonymous(s) Post