Mongu Trades Training Institute Management Board It Section Certificate in Computer Studies Term Two Assignment
Mongu Trades Training Institute Management Board It Section Certificate in Computer Studies Term Two Assignment
IT SECTION
COURSE: PROGRAMMING
LECTURER: MR MBUMWAE
#include <iostream>
#include <vector>
#include <string>
Int main()
Vector<string> candidates(10);
Vector<int> votes(10);
Int total_votes = 0;
Cout << “Enter the number of votes for “ << candidates[i] << “: “;
Total_votes += votes[i];
{
Double percentage = (static_cast<double>(votes[i]) / total_votes) * 100; Cout <<
“Candidate: “ << candidates[i] << “, Votes: “ << votes[i] << “, Percentage: “ << percentage <<
“%\n”;
Int winner_index = 0;
Winner_index = I;
Cout << “\nThe winner is “ << candidates[winner_index] << “ with “ << votes[winner_index]
<< “ votes.\n”;
Return 0;
1. Prompt the user to enter the names and votes for 10 candidates.
3. Display each candidate’s name, votes received, and percentage of total votes. 4.
int main() {
//we can enter the number of 1000 customers, we start with 5 customers
double rate2 = 3.50; const double rate3 = 4.50; const double gstRate
= 0.15;
unitsConsumed; double
cout << "Enter units consumed for customer " << i<< ": ";
} else {
}
gst = electricityCharges * gstRate;
cout << "Electricity Charges: ZMK " << electricityCharges << endl;
cout << "General Sales Tax: ZMK " << gst << endl; cout <<
"Amount Due: ZMK " << amountDue << endl << endl;
return 0;
4. Display the Electricity Charges, General Sales Tax, and Total Amount Due.
References
(1) . https://www.chegg.com/homework-help/questions-and-answers/1-good-
normallycosts-50-purchase-10-units-discounted-price-20-applies-upper-limit-total-q-
q123637048.
(2) . https://www.chegg.com/homework-help/questions-and-answers/manufacturer-
newproduct-claims-product-increase-output-per-machine-least-38-units-per-
houq43768444.
(3) https://www.chegg.com/homework-help/questions-and-answers/customer-
tableemployee-table.... https://www.chegg.com/homework-help/questions-
andanswers/customer-table-employee-table-supplier-table-product-returns-table-
producttable-sales-tab-q103576344.
(4) https://www.numerade.com/ask/question/a-company-produces-a-product-
anddelivers-to-its.... https://www.numerade.com/ask/question/a-company-produces-
aproduct-and-delivers-to-its-customers-for-orders-placed-online-value-of-the-product-
isrs-1000-and-a-delivery-fee-of-rs-300-per-product-is-charged-a-discount-of-3-was-
alsogiven-f/.
(5) https://github.com/googlecolab/colabtools/issues/16.
https://github.com/googlecolab/colabtools/issues/16.