Questions
Consider the following relations and relationship property(propertyNo, ownerID, type, rent, address) Newspaper(newspaperNo, name, street, city, zipCode,...

Consider the following relations and relationship

property(propertyNo, ownerID, type, rent, address)

Newspaper(newspaperNo, name, street, city, zipCode, phoenNo)

Advertisement(propertyNo, newspaperNo, date, cost)

1. List the propertyNo of all the properties that have been advertised on “Houston Chronical”

2. List the names of all the newspapers where the properties with rent greater 1000 have been posted.

In: Computer Science

Write in C++ Comment Steps A bank charges $10 per month plus the following check fees...

Write in C++

Comment Steps

A bank charges $10 per month plus the following check fees for a commercial checking account:

$0.10 each for fewer than 20 checks

$0.08 each for 20 - 39 checks

$0.06 each for 40 - 59 checks

$0.04 each for 60 or more checks

The bank also charges an extra $15 if the balance of the account falls below $400 (before any check fees are applied). Write a program that asks for the beginning balance and the number of checks written. Compute and display the bank's service fees for the month

INPUT VALIDATION: Do not accept a negative value for the number of checks written. If a negative value is given for the beginning balance, display an urgent message indicating the account is overdrawn.

In: Computer Science

Write a Y86 program in C language that sorts an array of data using Bubble Sort....

Write a Y86 program in C language that sorts an array of data using Bubble Sort. Allow the user to input up to 10 numbers from the keyboard. Sort the array in place (i.e., no need to allocate additional memory for the sorted array). Your program should be a complete one

In: Computer Science

Write the pseudo code for this problem based on what you learned from the video. The...

Write the pseudo code for this problem based on what you learned from the video. The purpose is to design a modular program that asks the user to enter the length and width, and then calculates the area. The formula is as follows:

Area = Width x Length

In: Computer Science

Write a java program to let the user enter the path to any directory on their...

Write a java program to let the user enter the path to any directory on their computers. Then list all the files in that directory.

In: Computer Science

Java Program that prompts the user and reads in an integer between 0 to 50, inclusively....

Java Program that prompts the user and reads in an integer between 0 to 50, inclusively. If the entered value is outside the range, program’s output will display the following message: “Error: the entered number is out of range”, and continually re-prompts the user to enter the integer again until the user enters a valid integer. • Once a valid integer has been entered, program prompts the user and reads in a second integer between -5 to 20, inclusively. If the entered value is outside the range, program’s output will display the following message: “Error: the entered number is out of range”, and continually re-prompts the user to enter the integer again until the user enters a valid integer. • Once both integers have been entered, program prompts for and read in the arithmetic operation that the user wish to perform: addition (+), subtraction (+), multiplication (*), division (/), or modulus (%). If the entered operation is other than those listed, program’s output will display the following message: “Error: Invalid operation”, and exit the program. • The requested operation will be performed, and program’s output will show details of the operation. • Division by zero can occur with the user input. In that scenario, program’s output simply display “Error: Division by zero” and exit the program. • You also need to find out whether the result of the operation is negative, positive or zero and program’s output will display accordingly. • Comments your code (variable declaration, blocks of code, calculation)

In: Computer Science

Explain what composition is and how to use it.

Explain what composition is and how to use it.

In: Computer Science

Jane has an intent to penetrate the network in an organization. She has used passive reconnaissance...

  1. Jane has an intent to penetrate the network in an organization. She has used passive reconnaissance to gather extensive information on the company. She finds out the model numbers of routers and other devices by reading discussions between system administrators in forums. She also has a list of all the IT staff and their phone numbers. She also has the services running on ports on some machines she ran a network scanner on.
    1. What reasonable steps should the company have taken to prevent Jane from finding this information?
    2. What steps should the company take to prevent or reduce the efficacy of port scans?

In: Computer Science

This exercise just lets you focus on data types, statements, etc. in C# to ease you...

This exercise just lets you focus on data types, statements, etc. in C# to ease you into the language. This

exercise is designed to allow you to focus on the data types that are appropriate for attributes of real-
world objects. Later, you will start to combine these attributes with behaviors (methods) and then

transition them into object-oriented classes.
Also, this exercise does not give explicit instructions on every field required. You will be required to
think through the attributes of these "objects" as you create the necessary data to support them in an
application.
Create a C# Console application. Within the Main() method in this application, create variables of the
correct data type for the following:
• Student information, such as:
o First Name
o Last Name
o Birthdate
o Address Line 1
o Address Line 2
o City
o State/Province
o Zip/Postal
o Country
o Any other pertinent information you want to add for a student record
• Professor information with pertinent fields related to what a professor in real-life would have.
• A university degree with pertinent fields such as Bachelor or Master.
o A degree can be Bachelor of Science in Information Technology and include fields such as
Degree Name, credits required, etc. Some of the fields, such as course list and prerequisites
will need to wait until you know how to create arrays or collections.

• A university program with pertinent fields. Fields might include:
o Program name (examples might be Business, Information Technology)
o Degrees offered (Bachelor, Master, Ph.D.)
o Department Head
• Information for a course that would be part of your selected degree and program, with pertinent
fields. Examples might be "Introduction to Computer Science" or "Introduction to Psychology".

Once you have the variables created, use assignment statements to assign values to them and use the
Console.WriteLine() method to output the values to the console window.
Challenge
Investigate the .NET Framework documenation around Console.ReadLine() and modify your code to use
this method for accepting input from a user of your application and assign it to the variables you have
created.

In: Computer Science

USING YOUR KNOWLEDGE OF MODULES, REWRITE THE FOLLOWING BATCH OF CODE USING PSEUDOCODE AND CREATE A...

  1. USING YOUR KNOWLEDGE OF MODULES, REWRITE THE FOLLOWING BATCH OF CODE USING PSEUDOCODE AND CREATE A FLOWCHART TO REPRESENT THE LOGIC:

There’s one thing every coder must understand.

The System.out.println command.

There’s one thing every coder must understand.

The System.out.println command.

In: Computer Science

C++ Write a function called gen_dates() that generates random dates. It takes two arrays of integers...

C++ Write a function called gen_dates() that generates random dates. It takes two arrays of integers called months and days to store the month and day of each date generated, a constant array of 12 integers called num_of_days that specify the number of days of each of the 12 months and an integer called size that specifies how many dates to generate and randomly generates size dates, storing the generated months in months array and generated days in days array. The function must generate only valid dates. To do that, it sets the upper limit of the days to generate to the values given in num_of_days array that is passed as a parameter. The number of days for the 12 months stored in num_of_days array are as follows: 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31.

Write another function called search_date() that takes two arrays of integers called months and days, an integer for size (same as above) and two more integers for the month and day to search for within the two arrays of months and days. The function returns the index of the found date if found and -1 if not found.

In main, declare two arrays of integers of maximum size 50, called months and days, to hold the generated months and days. Also declare an array of integers called num_of_days and initiaize it to the number of days of each of the 12 months. Because February can have either 28 or 29 days, depending on if the year is a leap year or not, the program must ask the user to enter the current year (in main). If it's a leap year, the number of days for month 2 (February) must be set to 29, otherwise, it's set to 28. A year is a leap year if it's either divisible by 400 or if it's divisible by 4, but not by 100.

The program must also ask the user (in main) how many random dates to generate (size). Then, it must pass the months and days arrays, the num_of_days array and size to gen_dates() function and print the generated dates (in main).

Then, read a single date such as 9/21 and pass the two arrays, the size and the month and day to search for to search_date() function. If the specified date was found, print the index of the first date found in main or print in main that the date could not be found.

All user input must be read in main and generated dates printed in main. Do not use any global variables. The two specified functions must receive only specified parameters. The gen_date() function returns nothing and search_date() function returns the index of found date or -1. ?

In: Computer Science

**Java Programming Question** A class that implements a data type, “Point,” which has the following constructor:...

**Java Programming Question**

A class that implements a data type, “Point,” which has the following constructor:

Point(double x, double y, double z)

  • and, the following API:
    • double distanceto(Point q)
      • it returns the Euclidean distance between this and q.
        • The Euclidean distance between (x1, y1, z1) and (x2, y2, z2) is defined as sqrt( (x1-x2)^2 + (y1-y2)^2) + (z1-z2)^2).
    • String toString() – it returns the string representation of the point. An example would be (2.3,4.5,3.0).
    • Write a main method in the class that is used to test it.
      • It should create two Point objects using input provided by the user on the command-line.
      • Then it should print out the two points followed by their Euclidean distance

A sample run would be as follows.

>java Point 2.1 3.0 3.5 4 5.2 3.5
The first point is (2.1,3.0,3.5)
The second point is (4.0,5.2,3.5)
Their Euclidean distance is 2.90

**Java Programming Question**

In: Computer Science

programming language is c#. Create a method that prompts a user of your console application to...

programming language is c#.
Create a method that prompts a user of your console application to input the information for a student:

static void GetStudentInfo()
{
Console.WriteLine("Enter the student's first name: ");
string firstName = Console.ReadLine();
Console.WriteLine("Enter the student's last name");
string lastName = Console.ReadLine();
// Code to finish getting the rest of the student data
.....
}

static void PrintStudentDetails(string first, string last, string birthday)
{
Console.WriteLine("{0} {1} was born on: {2}", first, last, birthday);
}

1. Using the above partial code sample, complete the method for getting student data.
2. Create a method to get information for a teacher, a course, and program, and a degree using a
similar method as above.
3. Create methods to print the information to the screen for each object such as static
void PrintStudentDetails(...).
4. Just enter enough information to show you understand how to use methods. (At least three
attributes each).
5. Call the Get methods from the Main method in the application.
6. Call the Print methods from within each Get method.
Exceptions
1. At times, developers create method signatures early on in the development process but leave the
implementation until later. This can lead to methods that are not complete if a developer forgets
about these empty methods. One way to help overcome the issue of not remembering to complete
a method is to throw an exception in that method if no implementation details are present.
2. For this task, use MSDN to research the NotImplementedException exception.
3. Create a new method for validating a student's birthday. You won't write any validation code in this
method, but you will throw the NotImplementedException in this method.
4. Call the method from Main() to verify your exception is thrown.
Challenge
Using MSDN, research the System.DateTime type. Using the information you learn, modify your birth
date field for the student and/or teacher to ensure it used a DateTime type if you did not already
include that in your data for these objects.
• Remove your NotImplementedException statement in the validate method you created above.
• Create a try/catch block to catch invalid date entries and display a message to the user if this
occurs. (Console output)
• Assume that your student must be at least 18 years of age to enroll at a university.
• Write code that validates the student is at least 18 years old. You can use birth year and math or
you can calcuate from today's date and work back.
• Output an error message to the console window if the student's age is less than 18

In: Computer Science

Consider this set A = { a, b, c, d } and the following relations R6...

Consider this set A = { a, b, c, d } and the following relations

R6 = { ( a, a ), ( a, b), ( b, b), ( c, d ) }

R7 = { ( a, a), ( b, b ), ( b, c ), ( c, c ), ( c, d), (d, d) }

R8 = { (a, b), (a, d), ( b, a), ( d, a) , ( b, d) , (d, b) }

R9 = { ( a, a), ( b, c) }

R10 = { ( a, b), (b, d), (a, d), ( a, a ) , (b, b), (b, d) }

5. Which of the above relations are reflexive and state why ?

  

6. Which of the above relations are symmetric and state why ?

7. Which of the above relations are transitive and state why ?

In: Computer Science

There are four basic functions in math. They are addition, subtraction, multiplication and division. Children in...

There are four basic functions in math. They are addition, subtraction, multiplication and division. Children in 1st grade focus on addition. They are required to memorize their addition facts from 1 to 12.

Create a function that prompts the user to enter a number between 1 and 12. Then display - using the input supplied - the addition and subtraction math facts for that number from 1 to 12 for the number entered. The output should be the results of the mathematical calculations.

See below example below:

The user enters "5" as their input. Below is the expected output.

Addition Math Facts for "5"

5 + 1 = 6

5 +2 = 7

...

5 + 11 = 16

5 + 12 = 17

Subtraction Math Facts for "5"

12 - 5 =

11 - 5 =

10 - 5 =

...

7 - 5 = 2

6 - 5 = 1

5 - 5 = 0

* Please note the subtraction facts should stop at the input number - the input number because 1st graders are not prepared to learn about negative numbers.  

If the user enters a number not between 1 and 12, open an alert window stating that it is an invalid number, and prompt them to enter a number again meeting the criteria. Finally, if the number entered is bellow 6, make the background color blue and the text white, if the number is above 6 make the background color red and the text yellow, and if the number is six then make the background color white and the text black.

* Should be in HTML language.

HINT: use a variable and a window.prompt() to store what the person enters, a conditional statement, and string concatenation using HTML as we discussed in class.

In: Computer Science