C++ lang. Quiz.dat
TFTFTFTFTTTFFFT
TFTFTFTFTTTFFFTJoe Jones
TFTFTFTFTTTFFFFJanet Jerome
TFTTTFTTTTTFFFTBetty Blaire
TTTFTFTFTTTFFFFBob Blaine
TFTFTTTTTTTFFFTRobby Roberts
FTTFTFTFTTTFFFTRobin Rogers
TFTFTFTFTTTFTTTCarla Cross
TFTFTTTTTTTFFFTCarl Cream
TTTTTTTTTTTTTTTNell North
FFFFFFFFFFFFFFFNed Nest
TFTFTFTFTFTFTFTDarla Darn
FTFTFTFTFTFTFTFDean Darling
#include<iostream>
#include<string>
#include<fstream>
using namespace std;
int main(){
ifstream fin("quiz.dat");
if (!fin){
cout << "Error opening
file\n";
return 0;
}
string ans;
string str;
int count = 0;
getline(fin ,ans);
//cout << ans << endl;
while(getline(fin ,str)){
int n = str.size();
string name =
str.substr(14,n-15);
name = name.substr(1);
int hits = 0;
int miss = 0;
for (int i = 0; i<15; i++){
if (str[i]
== ans[i]){
hits++;
}
else
miss++;
}
cout << "name:" << name
<< " ";
cout << "Correct Answers:"
<< hits;
cout << " " <<
"Incorrect answers:" << miss << endl;
}
return 0;
}
#include<iostream>
#include<fstream>
using namespace std;
int main(){
ifstream fin("input163.txt");
if (!fin){
cout << "Error opening
file\n";
return 0;
}
int score[11];
int a, b;
for (int i = 0; i<10; i++){
score[i] = 0;
}
while (fin >> a >> b){
score[a] = score[a] + b;
}
int max = score[0];
int index = 0;
for (int i = 0; i<10; i++){
if (max < score[i]){
max = score[i];
index = i;
}
}
cout << "The winner is identifiction number " << index
<< " with score " << max << endl;
return 0;
}


C++ lang. Quiz.dat TFTFTFTFTTTFFFT TFTFTFTFTTTFFFTJoe Jones TFTFTFTFTTTFFFFJanet Jerome TFTTTFTTTTTFFFTBetty Blaire TTTFTFTFTTTFFFFBob Blaine TFTFTTTTTTTFFFTRobby Roberts FTTFTFTFTTTFFFTRobin Rogers...
Need help with this programming please this is the instruction
my teacher provided
Write a C++ class called "Sales" and a main( ) function that uses the class. Also, write documentation of your project. Below is a specification of the class. . INTRODUCTION A company has four salespeople (1 to 4) who sell five different products ( to 5)1. Once a day each salesperson passes in a slip for each different type of product sold. Each slip contains: The salesperson...
C++ Background information: A company has four salespeople who sell five different products. Once a day, each salesperson passes in a slip for each different type of product sold. First on the line is the salesperson name, second is the product number, and third is the sales volume for this product by this salesperson in dollars. For example, the line Tara 2 200.00 means that salesperson Tara reported sales of volume $200.00 for product number 2. Data: Eric 1 200000.00...
Lottery Game (15 Numbers). Design and implement a C++ program that generates 15 random non-repeating positive integer numbers from 1 to 999 (lottery numbers) and takes a single input from the user and checks the input against the 15 lottery numbers. The user wins if her/his input matches one of the lottery numbers. Your implementation must have a level of modularity (using functions) Functions you need to implement: Define function initialize() that takes array lotterNumbers[] as a parameter and assigns...
Please Write the following program in c# You are to write an application which will create a company, add agents (their name, ID, and weekly sales) to that company, and printout the details of all agents in the company. The application will contain three classes: Agent.cs, Company.cs, and CompanyTest.cs (this class is already provided). Flow of the application: The CompanyTest class creates an object of the Company class and reserves space for five agents. At this point if you call...
Mailboxes Java Peter the postman was bored one evening and he decided to experiment with the mailboxes in the mailroom. The mailboxes were numbered from zero to 200 (there were 201 total mailboxes). Initially all boxes were closed. Starting with mailbox #2, he opened the door of every even numbered mailbox. Next, beginning with mailbox #3 and going to every third mailbox, he opened its door if it was closed and closed it if it was open. Then he repeated...
The following is for java programming. the classes
money date and array list are so I are are pre made to help with
the coding so you can resuse them where applicable
Question 3. (10 marks) Here are three incomplete Java classes that model students, staff, and faculty members at a university class Student [ private String lastName; private String firstName; private Address address; private String degreeProgram; private IDNumber studentNumber; // Constructors and methods omitted. class Staff private String lastName;...
(2 bookmarks) In JAVA You have been asked to write a program that can manage candidates for an upcoming election. This program needs to allow the user to enter candidates and then record votes as they come in and then calculate results and determine the winner. This program will have three classes: Candidate, Results and ElectionApp Candidate Class: This class records the information for each candidate that is running for office. Instance variables: first name last name office they are...
PART 1 Modify the class ArrayList given in Exercise 1 by using expandable arrays. That is, if the list is full when an item is being added to this list, the elements will be moved to a larger array. The new array should have twice the size of the original array. Using the new class ArrayList, write a program to store 1,000 random numbers, each in the interval [0, 500]. The initial size of the array in the class should...
in java no mathcall please
ennas are out of date.Please sign was wkollieemail.cpeedu so we can verily your subscription Sign In ASSIGNMENT Unit 9 Methods, Arrays, and the Java Standard Class Library Reimplementing the Arrays class (60 points) The Arrays class, which is also part of the Java standard class library, provides various class methods that perform common tasks on arrays, such as searching and sorting. Write a public class called MyArrays, which provides some of the functionality which is...
The purpose of this problem is to practice using a generic Jar class. write in drjava Create a generic class, called Jar, with a type parameter that simulates drawing an item at random out of a Jar. For example the Jar might contain Strings representing names written on a slip of paper, or the Jar might contain integers representing a random drawing for a lottery. Include the following methods in your generic class, along with any other methods you’d like:...