Questions
Validating Input file, So for my C++ assignment, my professor says we need to validate the...

Validating Input file,

So for my C++ assignment, my professor says we need to validate the Input File, Which means, if the line is missing a comma, one of the 3 information, or the string is a white line, it will ignore it. If the line has a white line, the program will correct it and will read in the line.

I will store these into an Array, and display them in First name, Last name, and Number of Votes vertical columned categories.

Apparently I skipped this part of the lecture and book, since he won't tell me exactly and keeps telling me to read the book. But the book shows me how to make arrays, take a file and put it into an array. He said using substr and find() or something like that.

This is a sample of the txt file. My question is, What do i use to be able to take only the names and number and place them into an array. Please explain what each line is doing, even it is not completely obvious. I am a complete beginner.

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

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

This is the sample of the getline code we are HAVE to USE and FOLLOW.

void readFile(Candidate candidates[]) {

string line;

ifstream infile;

infile.open("elections.txt");

while (!infile.eof()) {

getline(infile,line);

// your code here

}

infile.close();

}

I DO NOT NEED A WHOLE CODE, JUST THE FUNCTION EXPLAINED WHAT THE FUNCTION AND THE CODE IS DOING BY LINE.

In: Computer Science

Revised experiment setup ty I-v A student wants to find out how much energy is lost...

Revised experiment setup ty I-v A student wants to find out how much energy is lost by the string rubbing at the edge of the table when the system moves by 30cm. They come up with two methods to make this measurement: Method 1: Calculate work done on the string by the table, Wedge=(T1−T2)xWedge=(T1−T2)x Where T1 and T2 are the magnitude of the force measured by the top and hanging IOLabs, respectively. x is the distance traveled by the IOLabs, measured using the wheel of the top IOLab. Method 2: Conservation of energy, Wedge=12(m1+m2)v2f−m2gxWedge=12(m1+m2)vf2−m2gx Where m1 and m2 are the top and hanging masses, respectively, and vf is measured using the wheel of the top IOLab. x is the distance traveled by the IOLabs, measured using the wheel of the top IOLab. The student does four trials of their experiment and makes the following measurements: Trial T1 (Newtons) T2 (Newtons) vf (m/s) 1 1.059 1.571 1.698 2 1.088 1.707 1.718 3 1.082 1.695 1.678 4 1.047 1.827 1.698 Additionally, the student determines the displacement (x) was 30cm, m1 is 202g and m2 is 351g. 1) Using method 1, what is the average measurement of the work done by the edge of the table on the string? (This value is NOT a magnitude). Joules 2) What is the size of the uncertainty on the average measurement from Method 1? You should do your calculation using the method described in the class handout on uncertainty. Joules 3) Using method 2, what is the average measurement of the work done by the edge of the table on the string? (This value is NOT a magnitude). Joules 4) What is the size of the uncertainty on the average measurement from Method 2? Joules 5) Compare the results from the two methods. What should you conclude about them? a) The results from the two methods disagree with each other b) The results from the two methods do not disagree with each other c) It is impossible to make a decision about these results 6) Explain how you decided if the two measurements agree or not. If they do not agree, identify a relevant assumption from the experiment that could cause the disagreement.

In: Physics

The causative agent for elephantiasis is the roundworm Wuchereria bancrofti which is an example of a(n)...

  1. The causative agent for elephantiasis is the roundworm Wuchereria bancrofti which is an example of a(n) ___________________?

  2. protozoan

    alga

    helminth

    none of these

  1. In an A-B exotoxin, which component binds to a receptor on the host cell?

    the A component

    the B component

  1. Which of these cell types are not immunologically specific?

  2. B cell

    T helper cell

    natural killer (NK) cells

    all of these are correct

  1. Lysozymes _________.  

    destroy bacterial cell walls

    are found in tears

    are found perspiration

    all these are correct

1. Innate immunity ______________.

is always slower than adaptive immunity in responding to pathogens

is nonspecific and present at birth

involves a memory component

involves T cells and B cells

1. Regarding the complement system, which of these is a possible result?

cytolysis

inflammation

opsonization

all these are correct

  1. Which of these is true about the structure of antibodies?

    they have 2 heavy chains and 2 light chains

    they have constant regions (C) and variable regions (V)

    chains are linked together by disulfide bridges

    all of these are correct

1. Which of the following is not one of Koch’s postulates?

same pathogen must be present in every case of the disease

the pathogen must be isolated from the diseased host and grown in pure culture

the isolated pathogen must cause the disease when it is inoculated into a healthy, susceptible laboratory animal

all of these represent one of Koch’s postulates

In: Biology

Purpose: Experiment the interactive mode with php Instruction: Implement the following two different requirements and compare...

Purpose: Experiment the interactive mode with php

Instruction: Implement the following two different requirements and compare the results:

Implementation 1: Create a html file (login.html) with a login form that contains two labels, two text boxes and one submit button as follows:

User Name: ______________

Password: _______________

submit

When a user enters values for user name and password text boxes and clicks the submit button, the values are sent to login_handle.php and the values are assigned to two variables: $username and $password. Then, the scripts respond to the user a welcome message with the user name. For example, if a user enters "Peter" as the user name and the password, then the script responds to the user "Welcome Peter!"

Implementation 2: Create a user.html file with a user form as follows:

User Name: ______________

submit

When a user enters a value for the user name text box and clicks the submit button, the value is sent to user_handle.php and assigned to a variable: $username. Then, the script responds to the user with a form with one label and one text box as follows:

Password: ______________

submit

When a user enters a value for the password text box and clicks the submit button, the value is sent to password_handle.php and the password value is assigned to a variable: $password. Then, the scripts respond to the user a welcome message with the user name. For example, if a user enters "Peter" as the user name in the user.html then the script shall respond to the user "Welcome Peter!"

In: Computer Science

Social Media Assignment I don’t want 10 pages. Watch one or more of these videos about...

Social Media Assignment

I don’t want 10 pages.

Watch one or more of these videos about the evils of social media.

https://www.youtube.com/watch?v=d5GecYjy9-Q

https://www.youtube.com/watch?v=iAV1DaLtw2c

https://www.youtube.com/watch?v=CkMh6xdJNeM

https://www.youtube.com/watch?v=7QWoP6jJG3k

https://www.youtube.com/watch?v=szQsPQW4GLo

https://www.youtube.com/watch?v=8lLbc3DWqfI

https://www.youtube.com/watch?v=fiZUWVwHpe0

There over 150 videos on YouTube about social media.

Answer the following questions in a WORD document which you will upload on the ASSIGNMENTS, ESSAY TAB.

  1. Which social media sites do you use? How many hours a week do you spend on them?
  2. How often do you check your smartphone in a day?
  3. Do you feel the social media you use is beneficial or detrimental to you? In what ways?
  4. Do you lose valuable sleep time because of the social media?
  5. Has the social media on your phone made your physical social life better or worse?
  6. Do you believe social media is affecting your brain?

Put your name of the paper. Copy question 1. Answer question 1. Copy question 2. Answer question 2. Etc

Save the document to your disk. Go to BB, click assignment, clicks essay. Click feb20. Click “browse your computer”. Upload the file and click submit.

In: Computer Science

Consider the following incomplete declaration of a Book class for 1a-1c. public class Book {   ...

Consider the following incomplete declaration of a Book class for 1a-1c.

public class Book

{

   private String title, author, edition;

   private int numPages;

   public Book { //part (a) } //default

   public Book(String t, String a, String e, int np) { //part (b) }

   public String getTitle() {…} //returns the title of this Book

   public String getAuthor() {…} //returns the author of this Book

   public String getEdition() {…} //returns the edition of this Book

   public int getNumPages() {…} //returns numPages of this Book

   public void printBookInfo() {

System.out.print(title + “ written by “ + author);

   }

}

1a) Write the default constructor for the Book class. Our default book will have the following values:

title: Surviving CSC330 in Times of Crisis

author: Richard Weir

edition: 1

numPages = 100

1b) Write the parameterized constructor for the Book class. All instance variables need to be assigned values.

1c) Declare an instance of the Book class called myBook. myBook can have any values you would like (that are appropriate!).

In: Computer Science

Consider the following incomplete declaration of a Book class for 1a-1c. public class Book {   ...

Consider the following incomplete declaration of a Book class for 1a-1c.

public class Book

{

   private String title, author, edition;

   private int numPages;

   public Book { //part (a) } //default    

   public Book(String t, String a, String e, int np) { //part (b) }

   public String getTitle() {…} //returns the title of this Book

   public String getAuthor() {…} //returns the author of this Book

   public String getEdition() {…} //returns the edition of this Book

   public int getNumPages() {…} //returns numPages of this Book

   public void printBookInfo() {

      System.out.print(title + “ written by “ + author);

   }

}

1a) Write the default constructor for the Book class. Our default book will have the following values:

            title: Surviving CSC330 in Times of Crisis

     author: Richard Weir

     edition: 1

     numPages = 100

1b) Write the parameterized constructor for the Book class. All instance variables need to be assigned values.

1c) Declare an instance of the Book class called myBook. myBook can have any values you would like (that are appropriate!).

In: Computer Science

List and describe at least two types of online intrusion. How does it affect your system?...

List and describe at least two types of online intrusion. How does it affect your system? What potential harm can they cause to you or your device? For each choice, explain how you can defend your system.

In 2016 a massive DDoS attack against a cloud service company called Dyn shocked security experts. Look for information about this attack online. How many IP addresses or devices were involved in this attack? What was the name of the malware? Name some of the Internet sites that were affected by this attack.

In: Computer Science

Choice Hotels Marriott International (2016/2015)-1 (2016/2015)-1 10-K CHH 2016 10-K Report CHH 2015 10-K Report 10-K...

Choice Hotels Marriott International (2016/2015)-1 (2016/2015)-1
10-K CHH 2016 10-K Report CHH 2015 10-K Report 10-K MAR 2016 10-K Report MAR 2015 10-K Report Choice percent change from 2015 to 2016 Marriott percent change from 2015 to 2016
Account Name 2016 10-K 2015 10-K Account Name 2016 10-K 2015 10-K Choice Marriott
CASH FLOWS FROM OPERATING ACTIVITIES OPERATING ACTIVITIES OPERATING ACTIVITIES
Net income $                      139,371.00 $                      128,029.00 Net income $                             780,000 $                             859,000 Net income 9% -9%
Adjustments to reconcile net income to net cash provided by operating activities: $                        11,705.00 $                        11,542.00 Adjustments to reconcile to cash provided by operating activities: $                             (77,000) $                             (41,000) Adjustments to reconcile to cash provided by operating activities: 1% 88%
Net cash provided by operating activities $                      152,035.00 $                      159,872.00 Net cash provided by operating activities $                         1,682,000 $                         1,515,000 Net cash provided by operating activities -5% 11%
CASH FLOWS FROM INVESTING ACTIVITIES CASH FLOWS FROM INVESTING ACTIVITIES CASH FLOWS FROM INVESTING ACTIVITIES
Net cash used by investing activities $                        98,467.00 $                        99,810.00 Net cash provided by (used in) investing activities $                       (2,409,000) $                           (367,000) Net cash used by investing activities -1% 556%
CASH FLOWS FROM FINANCING ACTIVITIES CASH FLOWS FROM FINANCING ACTIVITIES CASH FLOWS FROM FINANCING ACTIVITIES
Net change in cash and cash equivalents $                           9,484.00 $                        19,389.00 Net cash (used in) provided by financing activities $                         1,589,000 $                       (1,805,000) Net change in cash and cash equivalenets / Net cash provided by financing activities -51% -1.88

1. Based on your horizontal analysis of Choice Hotels' and Marriott International's operating, investing, and financing activites, which company is most attractive for an acquisition by the equity firm and why?

2. What advice would you give to the client, Choice Hotels, to improve their investing and financing activities?

3. Based only on the statement of cash flow, which company would you invest in and why?

In: Finance

List the components for the appropriate culture of collaboration recognized by the Center for Healthcare Governance...

List the components for the appropriate culture of collaboration recognized by the Center for Healthcare Governance (2003) which suggests factors the governing body can incorporate to improve the relationship between health systems and their physicians. In addition, identify the nine steps the Walker Company (2009) has identified that the board can take to understand needs, align focus, and build bridges. Provide a brief description of each step.

In: Operations Management