INPUT FILE INTO ARRAY. CHECKING FOR COMMAS AND SUCH. HOW TO DO? ****IMPORTANT**** PLEASE READ CAREFULLY ****IMPORTANT****
***GOALS***
HOW TO CHECK FOR COMMAS, TILL THE END OF FILE. IT WILL CHECK THE LINE FOR THE APPRORIATE FORMAT IN THE TEXT FILE. IF THERE IS MISSING A COMMA, IT WILL IGNORE, IF THERE IS A WHITE SPACE, IT WILL CORRECT AND READ LINE, IF IT IS MISSING 1 OF THE 3 INFORMATION, IT WILL IGNORE.
Display candidates’ names using displayList()
function
Execute the getWinner(Candidate[]) function to get the candidate
with the highest number of votes. Display his name along with
number of votes.
Execute the getLast(Candidate[]) function to get the candidate
with the lowest number of votes. Display his name along with number
of votes.
Calculate pScore for each candidate
Sort candidates by votes
Display sorted list using displayList() function
For three records with the highest pScore, use the roundScore
function to round the pScore
Display list again using displayList() function
void readFile(Candidate candidates[]) – reads the elections.txt file, fills the candidates[] array. Hint: use substr() and find() functions. Set Score to 0.
void List(Candidate candidates[]) – prints the array of Candidate
structs. One candidate per one line, include all fields. Use setw()
to display nice looking list.
void displayCandidate(Candidate candidates[]) – prints the complete
information about the candidate
.
Candidate First(Candidate candidates[]) – returns single struct
element: candidate with highest score
Candidate Last(Candidate candidates[]) – returns single struct
element: candidate with lowest score
void Votes(Candidate candidates[]) – function sorts the
candidates[] array by number of votes, the order in candidates[]
array is replaced
void Scores(Candidate candidates[]) – calculates the percentage
score for each candidate. Use the following formula:
??????=(CandidateVotes)/(sum of votes)*100%
Correct line for the reference: F=John,L=Smith,V=3342
The line errors that your program needs to detect, are as follows:
incorrect token / separator, example in line 5: F=Steven,L=JohnV=4429 --- (comma missing) – lines with this error need to be ignored
space in token, example in line 3: F=Hillary,X=Clinton, V=1622 --- lines with this error need to be read, error fixed, data included in your dataset
empty line, example in line 6 – empty lines need to be ignored
Example Textfile
F=Michael,L=John,V=3342
F=Danny,L=Red,V=2003
F=Hillary,L=Clinton, V=1588
F=Albert,L=Lee,V=5332
F=Steven,L=JohnV=4429
*IMPORTANT* How would I do the readFile function? It says to check if the commas are present, and that the program will correct the line if there is white spaces. How do i use the find() function? Please be DETAILED in explanations of each part of code. Beginner Coder. *IMPORTANT*
Code Skeleton We HAVE to follow. How Would i go about using this skeleton?YOU CANNOT CHANGE WHAT IS ALREADY THERE ON THE SKELETON, YOU MAY ADD EXTRA INFORMATION THOUGH:
#include <iostream>
#include <iomanip>
#include <string>
#include <stdlib.H>
#include <fstream>
using namespace std;
struct Candidate {
string Fname;
string Lname;
int votes;
double Score;
};
const int MAX_SIZE = 100;
void readFile(Candidate[]);
void List(Candidate[]);
void Votes(Candidate[]);
void displayCandidate(Candidate);
Candidate First(Candidate[]);
Candidate Last(Candidate[]);
void Scores(Candidate[]);
int main() {
}
void readFile(Candidate candidates[]) {
string line;
ifstream infile;
infile.open("elections.txt");
while (!infile.eof()) {
getline(infile,line);
// your code here
}
infile.close();
}
void List(Candidate candidates[]) {
}
void Votes(Candidate candidates[]) {
}
void displayCandidate(Candidate candidates) {
}
Candidate First(Candidate candidates[]) {
}
Candidate Last(Candidate candidates[]) {
}
void Scores(Candidate candidates[]) {
}
In: Computer Science

In the figure below, the switch
is left in position a for a long time interval and is then quickly
thrown to position b. Rank the magnitudes of the voltages across
the four circuit elements a short time thereafter from the largest
to the smallest.
a.ΔV1200 Ω > ΔVL > 12.0 V > ΔV12.0 Ω
b.ΔVL > ΔV1200 Ω > 12.0 V > ΔV12.0 Ω
c.ΔV1200 Ω > ΔVL = 12.0 V > ΔV12.0 Ω
d.ΔV1200 Ω = ΔVL > 12.0 V > ΔV12.0 Ω
In: Physics
1.let {v=(1,2,3,5,9),v2=(3,1,2,8,9),v3=(2,-5,5,9,4)} and {u1=(0,1,1,1,2),u2=(0,2,-2,-2,0)} be basis of subspaces V and U of R5 respectively.find a basis and the dimension of V+U and V intersection U.
2.does a matrix have a right inverse ?if so find one A=[2,-3,-7,11;3,-1,-7,13;1,2,0,2]
3.find the interpolating polynomial that passes through the point (1,2),)(-1,-8) and (2,1)
In: Advanced Math
Calculate E o , E, and ΔG for the following cell reactions
(a) Mg(s) + Sn2+(aq) ⇌ Mg2+(aq) + Sn(s)
where [Mg2+] = 0.035 M and [Sn2+] = 0.040 M
E o = V
E = V
ΔG = kJ
(b) 3Zn(s) + 2Cr3+(aq) ⇌ 3Zn2+(aq) + 2Cr(s)
where [Cr3+] = 0.090 M and [Zn2+] = 0.0085 M
E o = V
E = V
ΔG = kJ
In: Chemistry
(From Hardcover Book, Marsden/Tromba, Vector Calculus, 6th ed., Review Exercises for Chapter 2, # 7)
Use the chain rule to find D ( f ∘ g ) ( − 1 , 2 ) for f ( u , v , w ) = ( v 2 + w 2 , u 3 − v w , u 2 v + w ) and g ( x , y ) = ( 3 x + 2 y , x 3 y , y 2 − x 2 ).
In: Math
There is a Java program that is missing one recursive function:
public class BinarySearch {
/* / -1 when min > max
* | mid when A[mid] = v
* search(A, v, min, max) = | search(A,v,mid+1,max) when A[mid] < v
* \ search(A,v,min,mid-1) otherwise
* where mid = (min+max)/2
*/
public static int search_rec(int[] A, int v, int min, int max) {
return 0;
}
public static int search(int[] A, int v) {
return search_rec(A, v, 0, A.length-1);
}
/* Binary Search Test Framework
*
*/
public static void main(String[] args) {
int[] inputA = { 0, 1, 3, 4, 5, 6, 7, 8, 9, 10};
int[] inputV = { 3, 8, 2};
int[] expect = { 2, 7, -1};
boolean error = false;
for(int i = 0 ; i < inputV.length; i++) {
int answer = search(inputA, inputV[i]);
if(answer != expect[i]) {
System.out.printf("ERROR: search(A,%d) returned %d not %d.\n",
inputV[i], answer, expect[i]);
error = true;
}
}
if(error)
System.exit(1);
else
System.out.println("Good Job!");
}
}
In: Computer Science
MAJOR VESSELS OF THE BODY
Unless otherwise indicated, the veins have the same naming of the arteries and are paired with the artery. Most of the exceptions are found with superficial veins in the limbs, or veins in the thorax.
Vessels of the Thorax & Neck:
Aorta
Common Carotid A.
Brachiocephalic V.
• Arch of Aorta
• Subclavian A & V
• Superior Vena Cava
• Brachiocephalic Trunk • External Jugular V.
• Inferior Vena Cava
1. Focus on the difference between the Brachiocephalic TRUNK and the Brachiocephalic VEIN
2. What side of the body does the brachiocephalic trunk supply?
Vessels of the Upper Limb:
Axillary • Brachial
Ulnar • Cephalic V.
Median Cubital V.
• Radial
• Basilic V.
What are the 2 superficial veins of the upper limb that drain the skin and do not have paired arteries?
Is the Cephalic Vein found on the medial or lateral side of the arm?
Vessels of the Lower Limb:
Common Iliac •
Femoral •
Great Saphenous V. •
Internal Iliac • External Iliac Popliteal • Dorsal Venous Arch Small Saphenous V.
What are the 2 superficial veins of the lower limb that drain the skin and do not have paired arteries?
Is the Great Saphenous Vein found on the medial or lateral side of the leg?
PLEASE ANSWR ALL OF THE ABOVE.
In: Anatomy and Physiology
According to an airline, flights on a certain route are on time 8080% of the time. Suppose 1515 flights are randomly selected and the number of on-time flights is recorded. (a) Explain why this is a binomial experiment. (b) Find and interpret the probability that exactly 99 flights are on time. (c) Find and interpret the probability that fewer than 99 flights are on time. (d) Find and interpret the probability that at least 99 flights are on time. (e) Find and interpret the probability that between 77 and 99 flights, inclusive, are on time. (a) Identify the statements that explain why this is a binomial experiment. Select all that apply. A. The experiment is performed until a desired number of successes is reached. B. The trials are independent. C. The probability of success is the same for each trial of the experiment. D. The experiment is performed a fixed number of times. E. Each trial depends on the previous trial. F. There are two mutually exclusive outcomes, success or failure. G. There are three mutually exclusive possibly outcomes, arriving on-time, arriving early, and arriving late. (b) The probability that exactly 99 flights are on time is nothing. (Round to four decimal places as needed.) Interpret the probability. In 100 trials of this experiment, it is expected about nothing to result in exactly 99 flights being on time. (Round to the nearest whole number as needed.) (c) The probability that fewer than 99 flights are on time is nothing. (Round to four decimal places as needed.) Interpret the probability. In 100 trials of this experiment, it is expected about nothing to result in fewer than 99 flights being on time. (Round to the nearest whole number as needed.) (d) The probability that at least 99 flights are on time is nothing. (Round to four decimal places as needed.) Interpret the probability. In 100 trials of this experiment, it is expected about nothing to result in at least 99 flights being on time. (Round to the nearest whole number as needed.) (e) The probability that between 77 and 99 flights, inclusive, are on time is nothing. (Round to four decimal places as needed.) Interpret the probability. In 100 trials of this experiment, it is expected about nothing to result in between 77 and 99 flights, inclusive, being on time. (Round to the nearest whole number as needed.)
In: Statistics and Probability
A BC Ltd, an Australian company, purchases 240 000 GBP of inventory from DEF company, a listed British company. The inventory was shipped FOB shipping on 11 May 2016, and delivered on 30 May 2016. Payment was made on 30 July 2016.
Required:
Record the journal entries for the relevant transactions if the
exchange rates are as follows
(rounded to the nearest whole AUD, narrations are not
11 May 2016 1 AUD=0.58 GBP
30 May 2016 1 AUD=0.60 GBP
30 June 2016 1 AUD=0.56 GBP
30 July 2016 1 AUD= 0.53 GB P
In: Accounting
Tur3ig Practicum Week II: Scenario II Name: Ali Al-Ghafri IP. No: 12345 Mr. Ali is 60 years old male, presented to male Outpatient clinic with complains of recurrent urination, urgency, he has history of pain while urination for 3 days, and cloudy urine output which is associated with nausea and vomiting. Blood investigation revealed increased white blood cells WBCS in the urine. Mr. Ali verbalized that he has these complains for first time. V/S were taken and recorded: HR: 98/MIN, 110/50mmhg, Spo2: 94% in room air, RR: 22/min. He is diagnosed as urinary tract infection
1-Formulate 2nursing care plan with one actual nursing diagnosis and one potential nursing diagnosis.
2-Write detailed health education that you will give to Mr. Salim on the discharge
In: Nursing