Questions
Write a program that prompts the user for the length of one side of a triangle...

Write a program that prompts the user for the length of one side of a triangle and the sizes of the two adjacent angles in degrees and then displays the length of the two other sides and the size of the third angle.

In: Computer Science

implement a formula of your own choosing, as a Python function, following these instructions: You need...

implement a formula of your own choosing, as a Python function, following these instructions:

  • You need to write a function that takes multiple arguments (not input from the keyboard!), and that returns the result of a formula of your choosing (not printing the output on the screen!).
  • For your function definition, choose a formula from mathematics, science, or a related field.
  • Then, in the main part of the script, write the main Python code (outside of any function) that asks the user to input the appropriate values, then uses the function you just defined to do a calculation, and then outputs the result.
  • Make sure that the user of the script knows what they are expected to input, what the script is going to calculate, and what the output means. (Remember that units are important!)
  • Don't pick a formula that is too simple; make sure that it's got at least two variables, and that it uses more than one operation (so don't pick a formula such as the volume of a 'box' isVolume = length * width * height,

In: Computer Science

4 function calculator (op1 oper op2) using scheme language also include comments

4 function calculator (op1 oper op2) using scheme language

also include comments

In: Computer Science

C# Language Create a class called evaluateValue that declares 3 integer class variables: zeroValue, positiveValue and...

C# Language

  • Create a class called evaluateValue that declares 3 integer class variables: zeroValue, positiveValue and negativeValue. These should be declared as public and you should not use automatic properties to declare them.
  • Your class should have a constructor that takes one integer argument. In the constructor you will code if statements to set one of the three class variables (indicators) to 1 if the number sent to the constructor is either equal to zero, negative, or positive.
  • In the class provide a method printit() used to print the results
    • Evaluate the positive, negative, and zero indicator to determine which line to print. If the indicator is set to 1 then the indicator is true.
    • You will print one of three statements;
      • The number was zero.
      • The number was positive.
      • The number was negative.
  • In the default wrapper class named assignment3 and containing Main write the code in Main that declares one integer variable: val1.
  • Use Console Write and Readline and the convert method to take the integer entry from the keyboard and pass it to the evaluateValue constructor.
  • Instantiate an evaluateValue object and pass the integer values to the constructor.
  • From Main call the printit method which will print the resulting evaluation in the class object.

In: Computer Science

Pyramid of oranges, 2^x in each row, total for n rows using scheme language also include...

Pyramid of oranges, 2^x in each row, total for n rows using scheme language also include comments

In: Computer Science

The following task does not involve writing program code: instead, you will be writing function signatures...

The following task does not involve writing program code: instead, you will be writing function signatures for hypothetical functions (you will be defining functions in subsequent tasks).

  1. For this task, you are presented with several 'hypothetical' functions. These aren't built-in Python functions: they are functions that you will have to define (i.e. implement, write) yourself later. however, you only need to write a signature for each hypothetical function listed here:
    1. toThePower(): takes two numbers e.g. x and y , and returns the value of (x to the power y). For example, toThePower(3,3) returns 27, and toThePower(-0.1,3) returns -0.001.
    2. quadruplicate(): takes a string, and returns a string consisting of three copies of that string concatenated together. For example, quadruplicate("na") returns "nananana", and quadruplicate("..?") returns "..?..?..?..?".
    3. subtract(): takes two numbers, and returns the difference between them. For example, subtract(10,3) returns 7, and subtract(2.2,5) returns -2.8.
    4. overlap(): We are not going to tell you exactly what it does, but we will give you a few examples: overlap("banana","analyze") returns 3 (not 4), overlap("abracadabra","abraham") returns 4 (not 5), overlap("foobar","red") returns 1, and overlap("foobar","bazinga") returns 0.
    5. multiplicate(): We are not going to tell you exactly what it does, but we will give you a few examples: multiplicate("x",5) returns "xxxxx", multiplicate("goo",3) returns "googoogoo", and multiplicate("never",0) returns "" (the empty string).

In: Computer Science

Design an EER diagram for Motor, Inc.: Motor, Inc. is a car dealer that sells both...

  1. Design an EER diagram for Motor, Inc.:

Motor, Inc. is a car dealer that sells both new cars and second-hand cars. You are the technical consultant of Motor Inc. and are currently helping the company to develop a database system. Your job is to draw an ERD to help them design the database.

  • A car has a unique car ID, selling price, make, model, year, color, and car type (used to indicate a car is new or used).
  • Motor Inc. has approximately 100 employees. An employee has an employee ID, job title, gender, salary, list of certifications, date of birth, and age. If an employee is currently married to another employee of Motor Inc., the date of marriage and who is married to whom must be stored; however, no record of marriage is required if an employee’s spouse is not an employee. An employee can handle none to multiple cars depending on his/her job title. A car can be handled by one to at most three employees.
  • There are seven branches at this company, and each of which has a unique name. Each branch is located at different addresses, which contains information such as street, city, state, and zip code. Besides that, each branch has its own email address, and three phone numbers. Each branch has many employees. If there are less than three employees, the branch would be closed. An employee must belong to one and only one branch. Moreover, some employees are the branch heads for these branches. Each branch only needs one branch head, but an employee can manage multiple branches.
  • The company also wants to track its customers’ information. A customer must provide SSN when registered with the company. The company would typically ask a customer to report their household income, and occupation. A customer can visit none or multiple branches, and a branch can be visited by none to multiple customers.

In: Computer Science

1. Describe four cloud-specific security threats. 2. Are there any advantages in not including the MAC...

1. Describe four cloud-specific security threats.

2. Are there any advantages in not including the MAC in the scope of the packet encryption in SSH?

In: Computer Science

2 newer techinques of stream ciphers

2 newer techinques of stream ciphers

In: Computer Science

JAVA StudentId: Consist of the first two characters of the student's first name, student's birth year,...

JAVA

StudentId: Consist of the first two characters of the student's first name, student's birth year, and the last two characters of the last name. For instance, if the student full name is John Doe and birthyear is 1995, then the id will be Jo1995oe. Birthday is using GregorianCalendar.

String firstname

String lastname

GregorianCalendar birthday

In: Computer Science

true or false C++ a.    (T or F)  A member of a class can be a method or...

true or false C++

a.    (T or F)  A member of a class can be a method or an attribute.

b.    (T or F)The private attributes of a class cannot be accessed by the public methods of that class.

c.    (T or F)  The initialization of a variable in the declaration

Ex:  int counter = 0;

is not allowed inside a class definition.

d.    (T or F)  In C++ a class is a definition; it does not exist in RAM until an object is created, using the definition.

e.     (T or F)  A member of a class that was created “on the stack” (locally) can be accessed by using the dot operator (.) followed by the member name.

In: Computer Science

Drivers are concerned with the mileage obtained by their automobiles. One driver has kept track of...

Drivers are concerned with the mileage obtained by their automobiles. One driver has kept track of several trips by recording miles driven and gallons used for each trip. Develop a Java program that uses a while statement to input the miles driven and gallons used for each trip. The program should calculate and display the miles per gallon obtained for each trip and print the combined miles per gallon obtained for all tankfuls up to this point. Enter miles driven (-1 to quit): 287 Enter gallons used: 13 MPG this trip: 22.076923 Total MPG: 22.076923 Enter miles driven (-1 to quit): 200 Enter gallons used: 10 MPG this trip: 20.000000 Total MPG: 21.173913 Enter the miles driven (-1 to quit): 120 Enter gallons used: 5 MPG this trip: 24.000000 Total MPG: 21.678571 Enter the miles used (-1 to quit): -1

In: Computer Science

9.9 LAB: Artwork label (classes/constructors) Define the Artist class with a constructor to initialize an artist's...

9.9 LAB: Artwork label (classes/constructors)

Define the Artist class with a constructor to initialize an artist's information and a print_info() method. The constructor should by default initialize the artist's name to "None" and the years of birth and death to 0. print_info() should display Artist Name, born XXXX if the year of death is -1 or Artist Name (XXXX-YYYY) otherwise.

Define the Artwork class with a constructor to initialize an artwork's information and a print_info() method. The constructor should by default initialize the title to "None", the year created to 0, and the artist to use the Artist default constructor parameter values.

class Artist:
def __init__(self,name, birth_year, death_year):
self.name = 'None'
self.birth_year = 0.0
self.death_year = 0.0

def print_info(self):
if death_year == -1:
print('Artist:', name,'born' ,birth_year)
else:
print('Artist:', name,'(',birth_year,'-',death_year,')')
  
class Artwork:
  def __init__(self,title,year_created,artist):
self.title = 'none'
self.year_created = 0.0
self.artist = Artist(name,birth_year,death_year)

def print_info(self):
print('Title:',end= ' ')
print(title,end= ' ')
print(year_created)

if __name__ == "__main__":
user_artist_name = input()
user_birth_year = int(input())
user_death_year = int(input())
user_title = input()
user_year_created = int(input())

user_artist = Artist(user_artist_name, user_birth_year, user_death_year)

new_artwork = Artwork(user_title, user_year_created, user_artist)
  
new_artwork.print_info()

Whats wrong with my code? It keeps saying Title and Artist arn't defined. And it won't print class artist.

In: Computer Science

Create, test, and validate an HTML document that defines a table with columns for state, state...

Create, test, and validate an HTML document that defines a table with columns for state, state bird, state flower, and state tree. There must be at least five rows for states in the table.

In: Computer Science

I have a error code, for my C++ class, using Putty include <iostream> using namespace std;...

I have a error code, for my C++ class, using Putty

include <iostream>

using namespace std;

int main()
{
char answer;
char grade;

cout << "Are you taking a class (enter y, Y, N or N): " << endl;
cin >> answer;

if (answer == 'N' || 'n');
{
cout << "Thanks for using the system" << endl;
}

else if (answer == 'Y' || 'y');
{
cout << "Enter a letter grade (A, B, C, D, or F): " << endl;
cin >> grade;


switch(grade);
{
case 'A':
cout << "Great Job!" << endl;
break;

case 'B':
cout << "Great Job!" << endl;
break;

case 'C':
cout << "You're doing alright." << endl;
break;

case 'D':
cout << "You can improve." << endl;
break;

case 'F':
cout << "You can improve." << endl;
break;

default:
cout << "Invalid grade." << endl;
break;
}
}

else
{
cout << "Invalid input" << endl;
}

return 0;
}


In: Computer Science