Questions
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

1, If we want to display output from a command, such as DIR or TYPE, one...

1, If we want to display output from a command, such as DIR or TYPE, one screen at a time, we can use what kind of command?

> MORE

| PAGE

| MORE

>> PAGE

2, To delete a directory that contains subdirectories and/or files, we will use what command:

DEL directory name /S

MD directory name /S

RD directory name /S

RMDIR directory name

3, When we are using certain tools (e.g. WMIC, DISKPART, and NETSH) in the Interactive Mode, most of the internal Command Prompt commands, such as CLS and CD, would not work. However, which command will work?

BYE

EXIT

| MORE

START

4, When we use this command in a batch file, the user must pick from the available options because Command Prompt won't let s/he pick anything else:

CHOICE

IF ELSE

FOR

SET

In: Computer Science

Fill in the blanks in the following C statement such that it allocates memory for an array of 50 character values:

  1. (3 pts) Fill in the blanks in the following C statement such that it allocates memory for an array of 50 character values:

char *name = (                ) malloc(                        );

  1. (3 pts) Write a declaration for an array a of 10 strings, each of which has at most 80 characters (including the null character):

                                                 __________________________________________

  2. (6 pts) Circle or underline all syntax, logic, and runtime errors found in the following C fragment. Be sure to circle omitted punctuation.

char *name_ptr == NULL, name[50] = “Barack Obama”,

        *name2 = “Joe Biden”;

                  name_ptr = name[0];

                  do

                  {

                           printf (“Enter a new name: ”)

                           scanf (“%c”, name_ptr);

                  while (name == name2);

                 

                                                          

  1. (2 pts) What are two advantages of using recursion in a C program?

    1. __________________________________________________________________

    2. __________________________________________________________________

  2. (8 pts) Complete the following statements based on this declaration. Assume that the operations are cumulative:

         char taste[11] = "bitter", touch[5] = "soft";

The value of strlen(taste) is                 . The contents of touch[4] is                .

The value of strcmp(“soft”, taste) is negative/positive/zero (circle one). The contents of touch after the call strncpy(touch, taste, 3) is                          . The contents of taste[2] after the call strncat(taste, &touch[3], 1) is                                    .



In: Computer Science

I need to write a program in python for a restaurant. The program should let the...

I need to write a program in python for a restaurant. The program should let the user enter a meal number, then it should display the meal name, meal price, and meal calories. Also, needs the appropriate output if the user enters an invalid meal number. I am supposed to use a dictionary, but my problem is it keeps giving me an error and telling me my menu is not defined. Not sure what I am doing wrong.


print ("Welcome to INN N OUT, what would you like to order today?")
print("------Menu------")
print("Double Double - 1")
print("Cheeseburger - 2")
print("Hamburger - 3")

def Menu():
menu = {

1 : {'name' : 'Double Double','price' : 3.45,'calories' : 670},

2 : {'name' : 'Cheeseburger','price' : 2.40,'calories' : 480},

3: {'name' : 'Hamburger','price' : 2.10,'calories': 310}}

x = int(input("Make a selection: "))

if x >= 1 and x <= 3:
print("You ordered a " + menu[x]['name'] + ". That is " + menu[x]['calories'] + ". Your total will be $" + menu[x]['price'])

else:
print("Invalid entry.")

Menu()

In: Computer Science

In C++ Create a program that uses Selection Sort and Insertion Sort for the National Football...

In C++

Create a program that uses Selection Sort and Insertion Sort for the National Football League list of current players. It's going to be a big list(over 1000 names). Please identify, in comments, which part of the code is for the Selection Sort and which part of the code is for Insertion Sort. It must have both.

Inputting data from a text file named "Players.txt"

Only want the name of the player(first name then last name), their team name, and position they play.

Example is:

Name Team Position
Patrick Mahomes Chiefs Quarterback
Julio Jones Falcons Wide Receiver
Fletcher Cox Eagles Defensive Tackle

Structure of the input file is:

Patrick Mahomes, Chiefs, Quarterback

Julio Jones, Falcons, Wide Receiver

Fletcher Cox, Eagles, Defensive Tackle

Output both lists separately(please indicate which lists goes with which sorting method) to a text file along with how long it took to go through the Selection Sort and Insertion Sort and how many iterations it took for each.

Thanks.

If you can't do this then can you please let someone else.

In: Computer Science

Sub HW4_1_1() 'a. Using the properties window in the VB editor assign ' the code name...

Sub HW4_1_1()

'a. Using the properties window in the VB editor assign
' the code name wsEx2 to the sheet with tab name Sheet1.
'b. Using VBA code and the code name for worksheet Sheet1,
' make this worksheet the active sheet.
'c. Declare a range variable and assign to this variable
' the range from A2 to A10 in the worksheet Sheet1.
'd. Write VBA code to create a range name and call it “Scores”.
' This range name should refer to the range B6to B14 in
' the worksheet labeled Sheet2
'e. Write VBA code that uses an Excel worksheet function
' that calculates the weighted average score (i.e.,
' the dot product of the range defined in part c. and the range in part d.
' and place the calculated value in cell A12 of the Sheet1 worksheet.
'f. Using VBA code change the background color of cell A12 to green.
'g. Using VBA code change the font type in cell A12 to italic and bold.
'h. Using VBA code change the format property of cell A12 so that
' it is displayed as a number with exactly three digits to the right
' of the decimal point and at least three digits to the left of the decimal point.

End Sub

In: Computer Science

This class models people moving in together in real life using pointers in C++. What test(s)...

This class models people moving in together in real life using pointers in C++.

What test(s) could be added with the code below? At the end of this task, add them! (Answer this.)

class Person {  
public:       
    Person(const string& name) : name(name) {}
    void movesInWith(Person& newRoomate) {
        roomie = &newRoomate;        // now I have a new roomie            
        newRoomate.roomie = this;    // and now they do too       
    }       
    const string& getName() const { return name; }
    // Don't need to use getName() below, just there for you to use in debugging.
    const string& getRoomiesName() const { return roomie->getName(); }  
private:
    Person* roomie;       
    string name;  
};           

// write code to model two people in this world       
Person joeBob("Joe Bob"), billyJane("Billy Jane");         

// now model these two becoming roommates       
joeBob.movesInWith(billyJane);         

// did this work out? (Answer this and explain why.)      
cout << joeBob.getName() << " lives with " << joeBob.getRoomiesName() << endl;
cout << billyJane.getName() << " lives with " << billyJane.getRoomiesName() << endl;

What changes can be made to the Person class above to keep the methods "safe"? For example, the movesInWith method.

I dont understand what this above question means, please help!

In: Computer Science