Questions
Restaurant Selector You have a group of friends coming to visit for your high school reunion,...

Restaurant Selector

You have a group of friends coming to visit for your high school reunion, and you want to take them out to eat at a local restaurant. You aren’t sure if any of them have dietary restrictions, but your restaurant choices are as follows:

  • Joe’s Gourmet Burgers

    • Vegetarian: No,

    • Vegan: No,

    • Gluten-Free: No

  • Main Street Pizza Company

    • Vegetarian: Yes,

    • Vegan: No,

    • Gluten-Free: Yes

  • Corner Café

    • Vegetarian: Yes,

    • Vegan: Yes,

    • Gluten-Free: Yes

  • Mama’s Fine Italian

    • Vegetarian: Yes,

    • Vegan: No,

    • Gluten-Free: No

  • The Chef’s Kitchen

    • Vegetarian: Yes,

    • Vegan: Yes,

    • Gluten-Free: Yes

Write a program that asks whether any members of your party are vegetarian, vegan, or gluten-free, and then display only the restaurants that you may take the group to. Here is an example of the program’s output:

Is anyone in your party a vegetarian? yes[Enter]
Is anyone in your party a vegan? no[Enter]
Is anyone in your party gluten-free? yes[Enter]
Here are your restaurant choices:
    Main Street Pizza Company
    Corner Cafe
    The Chef’s Kitchen

Here is another example of the program’s output:

Is anyone in your party a vegetarian? yes [Enter]
Is anyone in your party a vegan? yes [Enter]
Is anyone in your party gluten-free? yes [Enter]
Here are your restaurant choices:
    Corner Cafe
    The Chef’s Kitchen

In: Computer Science

In Java, please create a new Java application called "CheckString" (without the quotation marks) according to...

In Java, please create a new Java application called "CheckString" (without the quotation marks) according to the following guidelines.

** Each method below, including main, should handle (catch) any Exceptions that are thrown. ** ** If an Exception is thrown and caught, print the Exception's message to the command line. **

  1. Write a complete Java method called checkWord that takes a String parameter called word, returns nothing, and is declared to throw an Exception of type Exception. In the method, check if the first character of the parameter is a letter. If it is not a letter, the method throws an Exception of type Exception with the message of: "This is not a word."
  2. Write a complete Java method called getWord that takes no parameters and returns a String. The method prompts the user for a word, and then calls the checkWord method you wrote in #1 above, passing as a parameter the word the user provided as input. Make sure the getWord method handles the Exception that may be thrown by checkWord.
  3. Write a complete Java method called writeFile that takes two parameters: an array of Strings (arrayToWrite) and a String (filename). The method writes the Strings in the arrayToWrite array to a text file called filename (the parameter), with each String on a separate line.
  4. Write a complete Java method called readFile that takes a String as a parameter (filename) and returns an ArrayList of Strings (fileContents). The method reads the text file identified by the filename parameter and populates the ArrayList with an element for each line in the text file.
  5. In your main method, do the following in the order specified:
    1. Call the getWord method you wrote in #2 above and print the result to the command line.
    2. Create an array of Strings called testData and populate it with at least three elements.
    3. Call the writeFile method you wrote in #3 above passing the array you created in #5.2 and the String "data.txt".
    4. Call the readFile method you wrote in #4 above to read the file you wrote in #5.3. Assign the result of readFile to an ArrayList variable in main called fileContents.
    5. Write a loop to print the contents of the fileContents ArrayList to the command line.

In: Computer Science

Write a for-each loop that prints all of the Student objects in an ArrayList<student> object called...

Write a for-each loop that prints all of the Student objects in an ArrayList<student> object called roster. Write this piece in Java.

Write the correct code to execute.

In: Computer Science

in C++. Implement a structure to handle a college course information. You will also use functions...

in C++.

Implement a structure to handle a college course information. You will also use functions to manipulate the structure. Follow the instructions step by step to complete the homework successfully.

(1) Create a structure course. The structure should include the following attributes:

  • title; string
  • code; string
  • class_size; integer
  • enrolled; integer
  • roster; array of strings of fixed size 100

Important! The names of the structure and each of its field must match exactly for the program to work and be graded correctly.

Before moving on with the exercise, it is recommended that you self-test your structure in the main function (create a structure, assign values and print them…). Just make sure to remove these changes from the main before you continue.

(2) function getCourseFromFile(). This function takes as argument the name of a file where course information is stored, reads the file, and returns a structure with that information.

The format of the file is the following:

<Course name>
<Course code>
<Course class size>
<Student1>
<Student2>
<Student3>
...

In the function, open a file stream using the file name passed as argument. If the file is not opened successfully, print

Error! File not found.

Else, read the information from the file into a local structure variable (the variable to be returned). You can assume that the number of students in the file will not exceed the size of the array.

Note that the number of students enrolled is not know and has to be determined while reading the list of names in the file.

This function is tested using unit testing.

(3) function checkCourseSize(). This function takes as argument a course structure and returns true if the number of students enrolled is less or equal the class size, and false otherwise.

This function is tested using unit testing.

(4) function printRoster(). This function takes as argument a course structure and prints all the students to standard output, each one on a new line.

(5) function saveCourseSummary(). This function takes two arguments: a string with the desired output file name, and a course structure. Then saves in the output file the following course summary:

Course title: <title>
Course code: <code>
Class size: <size>
Students enrolled: <enrolled>

Additionally, it uses the function checkCourseSize and if the function returns false (too many students enrolled), it adds to the file the following message:

Enrollment exceeds class size. Drop students or find bigger classroom.

In: Computer Science

What is the Family Educational Rights and Privacy Act (FERPA)? Why was it passed into law?...

What is the Family Educational Rights and Privacy Act (FERPA)? Why was it passed into law? How does it affect the IT part of an organization? (150+ words, please)

In: Computer Science

C++ PROGRAM (Pointers and char arrays) IMPORTANT NOTES: 1. CHAR ARRAY MUST BE USED. 2. YOU...

C++ PROGRAM (Pointers and char arrays)

IMPORTANT NOTES:

1. CHAR ARRAY MUST BE USED.

2. YOU MUST USE POINTERS.

3. YOU MUST USE THE SWITCH STATEMENT TO EXECUTE THE PROGRAM.

4. ALL MODIFICATIONS MUST BE DONE IN THE SAME ORIGINAL CHAR ARRAY WITHOUT CREATING A NEW ONE.

Write a C++ program that modifies a null teminated char array as follows:

Consonants are positioned at the beginning of the string and vowels are moved to the end of the string.

Example :

Original string : density

New string : dnstyei

In: Computer Science

Question:   Can you please convert this program into switch case program using c++. Output should be...

Question:   Can you please convert this program into switch case program using c++.

Output should be same

int main()

{

    bool weekend = false;

    unsigned char day = 0;

    bool isDay = true;

    cout << " Enter a char for a day of week:";

    cin >> day ;

    if (day == 'M' || day == 'm')

        cout << " This is Monday" << endl ;

    else if (day == 'T' || day == 't')

        cout << " This is Tuesday" << endl ;

    else if (day == 'W' || day == 'w')

        cout << " This is Wednesday" << endl ;

    else if (day == 'R' || day == 'r')

        cout << " This is Thursday" << endl ;

    else if (day == 'F' || day == 'f')

        cout << " This is Friday" << endl ;

    else if (day == 'S' || day == 's')

    {

        cout << " This is Saturday" << endl ;

        weekend = true ;

    }

    else if (day == 'U' || day == 'u')

    {

        cout << " This is Sunday " << endl ;

        weekend = true ;

    }

    else

    {

        cout << day << " is not recognized..." << endl ;

        isDay = false;

In: Computer Science

IN JAVA Create a program that uses a nested for loop to display a rectangle of...

IN JAVA Create a program that uses a nested for loop to display a rectangle of #'s with a given number of rows and columns,. This should only display the # when the column is an odd number (see examples below).

Get the number of rows and columns from the user, and display the result.

Examples:

If the user provided rows=4, and columns=7, the program should display a pattern as follows:

# # # #

# # #

# # # #

# # #  

If the user provide rows=2, and columns=5, the program should display a pattern as follows:

# # #

# #

etc.

Upload

In: Computer Science

What is the final value of variable x? x = 0 msg = "hello there!" for...

What is the final value of variable x?

x = 0
msg = "hello there!"
for character in msg:
    if character=="e":
        x += 1

In: Computer Science

What is the last value of variable x? y = 0 x = 0 while y<=10:...

What is the last value of variable x?

y = 0
x = 0
while y<=10:
    if y%2==0:
        x = x + 2
    y += 1

In: Computer Science

Python 3: Create functions to draw each of these with sides of size side:triangle, square, pentagon,...

Python 3:

Create functions to draw each of these with sides of size side:triangle, square, pentagon, hexagon
The function should be the shape + "2d"
Use import turtle and the turtle commands: forward(), left(), right(), pendown(), penup(), done(), color()
Use the goto(X,Y) function to allow the shape to be drawn at a specific location
Use the x,y, and side attributes for screen position and size

In: Computer Science

Briefly Describe three potential concerns that buyers of these smart connected products might have about this...

Briefly Describe three potential concerns that buyers of these smart connected products might have about this trend to smart, connected products.

In: Computer Science

****** please don't copy and paste and don't use handwriting ****** I need a unique answer...

****** please don't copy and paste and don't use handwriting

****** I need a unique answer

Q1: Write HTML code to get the following output that include the following elements.

  1. The title is: Favorite Books

  2. Large heading with text “Your Favorite Books”

  3. Form that has 3 input values (two text boxes and one drop down list)

  4. Drop-down list contains the following options,

  1. Pearson
    1. Wiley

    2. Mc-Graw Hill

  1. Submit information to “books.php” using GET request.

Q2:Display a simple message "Welcome" on your demo webpage. When the user hovers over the message, a popup should be displayed with a message "Welcome to our new WebPage!!!".

Q3:

Create XHTML and CSS file to show your information. Style the table to match the on in the picture. You are allowed to choose your preferred colors; however, you cannot change the style of the table.

  • The table must be centered in the page

  • Heading font is Times New Roman

  • Text in table cells must be centered

In: Computer Science

Write a script that represents a simple command line calculator. It will accept two numbers from...

Write a script that represents a simple command line calculator. It will accept two numbers from command line, and then display sum, difference and product of these two numbers. Provide script code and screenshot of output.

Using Linux Ubuntu bash

In: Computer Science

In this assignment, you will study databases and differentiate between the various database models and tools...

In this assignment, you will study databases and differentiate between the various database models and tools available to design databases.

Specify at least two real-life situations where you have seen a database in use and based on your observations, answer the following questions:

  • How different would each situation be without the database?
  • What are the components of the database or data storage system that you have seen in use?
  • Which type of database system is being used in the establishments where you have seen the database? How did you recognize this type of data storage system?
  • Why do these situations benefit from the use of databases? What are the factors that make it necessary to use databases in these examples?

Pick one of the database models and list at least two situations in which the model can be applied. You can choose to find the model used in the database that you find in your real-life situation and then answer.

Further, research the Internet for features of the tools that can help you create a database design. You can confine your search to:

  • Erwin
  • Visio
  • Power Designer

Based on your research, would you recommend any of these tools for database design based on the information available on the Internet? Why or why not? You may discuss other tools in addition to these.

In: Computer Science