#include

using namespace std;

class voting

{

int count[5];

int spoilt;

public:

void initial()

{

for(int i=0; i<5; i++)

{

count[i]=0;

}

spoilt=0;

}

void vote(int v)

{

if(v0)

{

if(v==1)

count[0]++;

else if(v==2)

count[1]++;

else if(v==3)

count[2]++;

else if(v==4)

count[3]++;

else

count[4]++;

}

else

spoilt++;

}

void dispvote()

{

int i;

for(i=0; i<5; i++)

{

cout<<"candidate"<<i+1<<":"<<count[i]<<endl;

}

}

void dispspoilt()

{

cout<<"total spoilt votes:"<<spoilt<<endl;

}

};

int main()

{

voting v1;

v1.initial();

int choice;

do

{

cout<>choice;

switch(choice)

{

case 1:

int v2;

cout<>v2;

v1.vote(v2);

break;

case 2:

v1.dispvote();

break;

case 3:

v1.dispspoilt();

break;

}

}

while(choice<4);

return 0;

}

The binary file’s name is bin.txt. The text file to save in should have the name text.txt

]]>How do i open a file which i have using c or c++

and is it possible that we can carry out arthemethic operations between two files.??? ]]>

http://www.cplusplus.com/reference/string/string/

https://www.tutorialcup.com/cplusplus/strings.htm

http://www.cprogramming.com/tutorial/string.html

*

* *

* *

* *

*********

*******

*****

***

* ]]>

I need the these programms in C Language

Program No. 1

Write a program to compute the wages of a daily laborer as per the following rules :-

Hours Worked Rate Applicable

Upto first 8 hrs Rs 50/-

For next 4 hrs Rs 10/- per hr extra

For next 4 hrs Rs 20/- per hr extra

For next 4 hrs Rs 25/- per hr extra

For rest Rs 40/- per hr extra

Accept the name of the laborer and no. of hours worked. Calculate and display the wages.

The program should run for N number of laborers as specified by the user.

Program No. 2

Define 2 dimensional array a (3,3), b(3,3),sum(3,3),diff(3,3),mult(3,3). Store 9 arbitrary

numbers in a(3,3) and 9 arbitrary numbers in b(3,3).

Do the following:

a) Calculate sum of a(3,3) and b(3,3) and store in sum(3,3) where

sum(i,j)=a(i,j)+b(i,j)

b) Calculate difference of a(3,3) and b(3,3) and store in diff(3,3) where diff(i,j)=a(i,j)-b(i,j)

c) Calculate product of two arrays a(3,3) and b(3,3) and store in mult(3,3) where

mult(i,j)= summation of a(i,k)*b(k,j) over k where k=1 to 3.

Print the result in a tabular form

60

Thanx in advance

]]>