Questions
Write a java program that does the following: a) The user will enter data such as...

Write a java program that does the following:

a)

The user will enter data such as client name and client balance. The user can stop inputting data by entering "stop". The program should store the user inputs as a data member of an array. The type of this array is a class named ClientData.

Below the output should be displayed by the program. The parts in bold are inputs from the user and not hard coded in the program

Client Name: Aaron

Client Balance: 100

Client Name: Barry

Client Balance: 200

Client Name: stop

b) The program will then ask the user to choose a function: Average or Sort or Stop. The program should ask the user "Please choose the next function: Average"

c) The Average program will call another method called BalanceAverage that will display the average of the Client's Balances. The program should output "The average client balance is : 100"

In: Computer Science

I keep getting this error "LetterDemo.cs(21,14): error CS1519: Unexpected symbol `string' in class, struct, or interface...

I keep getting this error "LetterDemo.cs(21,14): error CS1519: Unexpected symbol `string' in class, struct, or interface member declaration"

Can someone please help me.

Here is my code:

using static System.Console;

class LetterDemo

{

   static void Main()

   {

     Letter letter1 = new Letter();

     CertifiedLetter letter2 = new CertifiedLetter();

     letter1.Name = "Electric Company";

     letter1.Date = "02/14/18";

     letter2.Name = "Howe and Morris, LLC";

     letter2.Date = "04/01/2019";

     letter2.TrackingNumber = "i2YD45";

     WriteLine(letter1.ToString());

     WriteLine(letter2.ToString() +

      " Tracking number: " + letter2.TrackingNumber);

   }

}

class Letter

{

  pubic string Name {get; set;}

  pubic string Date {get; set;}

  public new string ToString()

  {

    return(GetType() + " To: " + Name + " Date mailed : " + Date);

  }

}

class CertifiedLetter : Letter

{

  public string TrackingNumber {get; set;}

}



In: Computer Science

The accompanying 2 files (boynames.txt and girlnames.txt) contain the results of a recent census of boy...

The accompanying 2 files (boynames.txt and girlnames.txt) contain the results of a recent census of boy and girl births in the last year. Each record of the files contain a given name and the number of new born children receiving that name. E.g.,

          Matthew 23567          or            Alison 17658

Each name is separated from the number by a blank space.

There are also some common names given to both boys and girls, e.g., Riley. They will appear in both the boy file and the girl file.

Write a PHP script that finds answers to the following questions.

  1. How many names are common to both boys and girls?
  2. List the common names with how many boys and how many girls have that name. Use an HTML table to display this data.
  3. How many total boys and how many total girls were born last year according to the census?

In: Computer Science

Modify the username.py program (see the lecture slide) to generate usernames using the user’s first initial,...

Modify the username.py program (see the lecture slide) to generate usernames using the user’s first initial, followed by up to 3 first letters of the user’s last name, and a number of total characters in the last name. User input can be up- or low-case. But the generated usernames contains only low-case characters and a number.

For example, if the person’s name is “Albert Einstein” à the username shall be ”aein8”

Tip: use len() function and string’s lower() method

To create the program(10 points): :

1. Create a module named h02_username2.py from the directory hw

2. Record your name, class number, and date of creation using python comment statement.

3. Write the code to implement the required tasks.

When you have completed the program, run the program and capture and paste the output below:

In: Computer Science

java programing Q: Given the following class: public class Student { private String firstName; private String...

java programing

Q: Given the following class:

public class Student {

private String firstName;

private String lastName;

private int age;

private University university;

public Student(String firstName, String lastName, int age, University university) {

this.firstName = fisrtName;

this.lastName = lastName;

this.age = age;

this.university = university;

}

public String getFirstName(){

return firstName;

}

public String getLastName(){

return lastName;

}

public int getAge(){

return age;

}

public University getUniversity(){

return university;

}

public String toString() {

return "\nFirst name:" + firstName + "\nLast name:" + lastName + " \nAge:"+ age + "\nUniversity" + university;

}

}

a- Create the University class (data type). The class must include name, state, and the country as member variables; it must also include methods for returning and storing the name, state, and country.

b- Create client code to test the classes.

In: Computer Science

Consider a text file that you will create named “employees.txt”. The file contains data organized according...

Consider a text file that you will create named “employees.txt”. The file contains data organized according to the following format:John Smith 10 15Sarah Johnson 40 12Mary Taylor 27 13Jim Stewart 25 8For instance, “John” is the first name, “Smith” is the last name, “10” is the number of hours per week, and “15” is the hourly rate.Write a program that computes the weekly salary of each employee. The program prints the first name, last name, and weekly salary of each employee in a file named “results.txt”. ‘results.txt” must be created automatically by your program. You must use a function to read/process the data from the input file and this function must have parameters. The “employees.txt” file must be opened from main and read from within your defined function. in c++

and how to do the screenshots on mac

In: Computer Science

create the UML Diagram to model a Movie/TV viewing site. Draw a complete UML class diagram...

create the UML Diagram to model a Movie/TV viewing site.

Draw a complete UML class diagram which shows:

  • Classes (Only the ones listed in bold below)
  • Attributes in classes (remember to indicate privacy level, and type)
  • No need to write methods
  • Relationships between classes (has is, is a, ...)

Use a program like Lucid Cart and then upload your diagram.

Each movie has:

name, description, length, list of actors, list of prequals and sequals

Each TV Show has:

name, description, list of places that show it (netflix, hulu, pbs kids), list of actors, list of episodes

Each Episode has:

name, description, number, season, list of actors

User:

  • first and last name
  • list of movies watched, list of tv shows and espisodes within those shows watched, list of favorites

In: Computer Science

Using python Write a program that has 3 functions, named write_to_file, read_from_file, and ask_user. The write_to_file...

Using python

Write a program that has 3 functions, named write_to_file, read_from_file, and ask_user.

The write_to_file function should have 2 parameters, file_name and data. When called, the function will open a file with the name stored in the file_name variable, write the information stored in data, then close the file.

The read_from_file function will have 1 parameter, file_name. When called, the function will open a file with the name stored in the file_name variable, print the contents of the file, then close the file.

The ask_user function will give the user a prompt asking whether they want to read or write a file, once a selection is made the program must ask the user for the information needed to run the function (if they select write, ask for file name and data to write to the file, if the select read, ask for file name).

Below the functions, in the main part of the program, write a for loop that loops 10 times calling the ask_user function.

In: Computer Science

Must be in C#: 7. E-MAIL ADDRESS BOOK Create a Windows Forms Application with a class...

Must be in C#: 7. E-MAIL ADDRESS BOOK Create a Windows Forms Application with a class named PersonEntry. The PersonEntry class should have properties for a person’s name, e-mail address, and phone number. Also, create a text file that contains the names, e-mail addresses, and phone numbers for at least five people. When the application starts, it should read the data from the file and create a PersonEntry object for each person’s data. The PersonEntry objects should be added to a List, and each person’s name should be displayed in a list box on the application’s main form. When the user selects a name from the list box, a second form should appear displaying that person’s name, e-mail address, and phone number. There are additional requirements; please see Main Differences between the Textbook Instructions and This Document above.

In: Computer Science

C++ Parse text (with delimiter) read from file. If a Text file has input formatted such...

C++ Parse text (with delimiter) read from file.

If a Text file has input formatted such as: "name,23" on every line where a comma is the delimiter, how would I separate the string "name" and integer "23" and set them to separate variables for every input of the text file? I am trying to set a name and age to an object and insert it into a vector.

#include <iostream>
#include <vector>
#include <fstream>
using namespace std;

class Student{
    public:
        string name;
        int age;
};

int main() {


    vector <Student>studentVector;
    Student s;
    string student_name;
    int student_age;
  
    ifstream myFile("file.txt");
      
    while(myFile>> student_name >> student_age){


        //s.name is assigning the entire line of unparsed text
        s.name = student_name;

       ///age is not read because input string from file is not parsed

        s.age = student_age;


        studentVector.push_back(s);
    }


    return 0;
}

In: Computer Science