Questions
Create a class named Lease with fields that hold an apartment tenant’s name, apartment number, monthly...

  1. Create a class named Lease with fields that hold an apartment tenant’s name, apartment number, monthly rent amount, and term of the lease in months. Include a constructor that initializes the name to “XXX”, the apartment number to 0, the rent to 1000, and the term to 12. Also include methods to get and set each of the fields. Include a nonstatic method named addPetFee() that adds $10 to the monthly rent value and calls a static method named explainPetPolicy() that explains the pet fee as folows: A pet fee of $10 is added to the monthly rent.

  2. Create a class named TestLease whose main() method declares four Lease objects. Call a getData() method three times. Within the method, prompt a user for values for each field for a Lease, and return a Lease object to the main() method where it is assigned to one of main()’s Lease objects. Do not prompt the user for values for the fourth Lease object, but let it continue to hold the default values. Then, in main(), pass one of the Lease objects to the showValues() method that displays the data. Then call the addPetFee() method using the passed Lease object and confirm that the fee explanation statement is displayed. Next, call the showValues() method for the Lease object again and confirm that the pet fee has been added to the rent. Finally, call the showValues() method with each of the other three objects; confirm that two hold the values you supplied as input and one holds the constructor default values.

EDIT: This is for Java.

In: Computer Science

scenario; imagine DHCP has been installed in the window server 2016, Question: how to verify that...

scenario; imagine DHCP has been installed in the window server 2016,

Question: how to verify that the DHCP has been installed correctly?

In: Computer Science

Write a program (in Q0.c) to do the following: In main(), declare an integer x. Print...

Write a program (in Q0.c) to do the following:

In main(), declare an integer x. Print the address of x (using the address-of operator). Pass x as an argument to a function void fooA(int* iptr). (Hint: can you pass x itself directly?)

In fooA(int* iptr), print the value of the integer pointed to by iptr, the address pointed to by iptr, and the address of iptr itself.

In the main function, following the call to fooA(...) , print the value of x.

Implement function int fooB(int* a, int *b, int c) which should perform the following computations:

Assign a + b to c.

Set the value pointed to by a to the value pointed to by b.

Set the value pointed to by b to double its original value.

Return the value of c.

In: Computer Science

Some things that need to be added to it are: Make it as simple as possible...

Some things that need to be added to it are: Make it as simple as possible

colors

background colors

fonts

borders

position everything horizontally

Heres the code I have so far:

<html>
   <head>
   <title> TheWebpage</title>
      
       <meta charset="utf-8" />
      
   </head>
       <body>
           <header>
               <h1>Welcome to my first web page.</h1>
           </header>
          
       <article>
       <h1>Favorite dream vacation</h1>
       <img src="Japansmap.jpg" alt="" />
       <p><strong>Japan</strong>
       Japan is one of my dream places I would like to take
       my dream vacation. From the way they take cleaning very seriously, to the cultural differences between America and
       Japan. Its a place I've dreamed of going to for a long time. From the city to the country side, both look stunning.
       Especially Mt. Fuji, which is a staple of Japan. Not only that, but the bullet trains let you get around the country
       very fast and at an affordable price. Overall its a country that I'm very interested in and would like to learn
       more about as time goes on.<p>
      
       </article>
  
       </body>
</html>

In: Computer Science

Describe (t,n) Shamir secret sharing scheme

Describe (t,n) Shamir secret sharing scheme

In: Computer Science

I'm trying to get an understanding of this code as it was done in class, can...

I'm trying to get an understanding of this code as it was done in class, can someone please explain step by step what is happening?

namespace BMI
{
class Program
{
static void Main(string[] args)
{
double height, weight;
Console.Write("Enter person's height in inches: ");
bool value1 = double.TryParse(Console.ReadLine(), out height);

Console.Write("Enter weight in pounds: ");
bool value2 = double.TryParse(Console.ReadLine(), out weight);
if (!value1 || !value2)
{
Console.WriteLine("Not valid input.");
}
else
{
if (height < 5 || height > 120)
{
Console.WriteLine("Not valid height.");
}
else if (weight < 0.5 || weight > 999)
{
Console.WriteLine("Not valid weight.");
}
else
{
double bmi = ((weight / (height * height)) * 703.0);
Console.WriteLine($"The BMI for someone who weighs {weight} lbs and is {height} in tall is " + Math.Round(bmi) + ".");

string catagory = "";
if (bmi < 16)
catagory = "severly underweight";
else if (bmi >= 16 && bmi < 18.5)
catagory = "underweight";
else if (bmi >= 18.5 && bmi < 25)
catagory = "healthy";
else if (bmi >= 25 && bmi < 30)
catagory = "overweight";
else
catagory = "obese";
Console.WriteLine("BMI Catagory: You are " + catagory + ".");
}
}
Console.WriteLine("\nPress any key to close the application:"); //newline operator
Console.ReadKey(); //terminates runtime
}
}
}

In: Computer Science

Which of these statements are true and which are false? (a) If f(n) = Θ(g(n)) and...

Which of these statements are true and which are false?

(a) If f(n) = Θ(g(n)) and g(n) = Θ(h(n)), then h(n) = Θ(f(n))  

(b) If f(n) = O(g(n)) and g(n) = O(h(n)), then h(n) = Ω(f(n))

(c) If f(n) = O(g(n)) and g(n) = O(f(n)) then f(n) = g(n)                                                     

(d) 100n = Ω(n2)    

(e) In the merge-sort execution tree, roughly the same amount of work is done at each level of the tree.  

(f) An algorithm is randomized if its behavior is determined in part by values produced by a random-number generator.   

(g) Quicksort can be used as the auxiliary sorting routine in radix sort, because it operates in place.   

In: Computer Science

Suppose you want to store line segments in an R-tree. If a line segment is not...

Suppose you want to store line segments in an R-tree. If a line segment is not parallel to the axes, the bounding box for it can be large, containing a large empty area.

Describe the effect on performance of having large bounding boxes on queries that ask for line segments intersecting a given region.


Briefly describe a technique to improve performance for such queries and give an example of its benefit. Hint: You can divide segments into smaller pieces.


In: Computer Science

PYTHON Write a program for an event organizer. The code can be as short as 7...

PYTHON

Write a program for an event organizer. The code can be as short as 7 lines; 9 lines are good enough!

a) Request the organizer to enter a participant’s full name in a single input. The input can take two different formats: i. l_name, f_name [1.5 pts] ii. f_name l_name [1.5 pts] b) Print a customized greeting message using the first name, regardless of the formats: “Dear f_name, welcome to the party!” with only the 1 st letter of f_name in upper case.

Hint 1: Try to work on one form, at a time. After figuring out how to do both, add an if statement.

Hint 2: Just need to use in, len(), .find() and, of course, input().

In: Computer Science

Write a program that read an array consists of 4 rows and 4 columns, then computes...

Write a program that read an array consists of 4 rows and 4 columns, then computes and print the sum of the elements above and below the main diagonal. (WITH C++)

In: Computer Science

car.txt 0001|Mercury|LeSabre|2005|Brown|11000|2019-09-01 0002|Chevrolet|Aveo|2013|Blue|12000|2019-09-02 0003|Datsun|240Z|1979|Orange|13000|2019-09-03 0004|Ford|Galaxie|1964|Black|14000|2019-09-04 0005|Porsche|Boxster|2014|Green|15000|2019-09-05 0006|Honda

car.txt

0001|Mercury|LeSabre|2005|Brown|11000|2019-09-01
0002|Chevrolet|Aveo|2013|Blue|12000|2019-09-02
0003|Datsun|240Z|1979|Orange|13000|2019-09-03
0004|Ford|Galaxie|1964|Black|14000|2019-09-04
0005|Porsche|Boxster|2014|Green|15000|2019-09-05
0006|Honda|Insight|2007|Silver|16000|2019-09-06

1) Design and implement a class of "car" with constructor and destructor, with member variable for each field, and method for get and set each field. (2) Read the file (car.txt) to instantiate each object for each record read from the file. (3) After the file input is done, then display each object to the console.

Car List

Record #1
(1) carID=0001
(2) carManufacturer=Mercury
(3) carModel=LeSabre
(4) carYear=2005
(5) carColor=Brown
(6) carPrice=11000
(7) carInventoryDate=2019-09-01

and so on.

Task#2. Output each object to a file (car1.txt) with the same format as shown in Task#1.

Car List

Record #1
(1) carID=0001
(2) carManufacturer=Mercury
(3) carModel=LeSabre
(4) carYear=2005
(5) carColor=Brown
(6) carPrice=11000
(7) carInventoryDate=2019-09-01

// sample c++ code for object to binary file IO.

// try c++ to compile this program

#include <iostream>

#include <fstream>

using namespace std;

class Student

{

public:

    char name[10];

    char address[10];

    char Gender;

    char DOB[10];

    Student()

    {}

};

int main()

{

    cout<<"\n Writting on file: Student1.txt \n";

  Student *p=new Student;

        cout<<1<<": ";

         cin>>p->name;

         cout<<"\n";

    // to append use ios::app

    // ofstream osfile("Student1.txt",ios::binary|ios::app);

    ofstream osfile("Student1.txt",ios::binary);

    osfile.write((char*)p,sizeof(Student));

    osfile.close();   

   cout<<"\n reading Student1.txt \n";

    Student *p2=new Student;

    ifstream isfile("Student1.txt",ios::binary);

    isfile.read((char*)p2,sizeof(Student));

    isfile.seekg(0);

    isfile.close();

        cout<<1<<": ";

        cout<<p2->name;

        cout<<"\n";

    return 0;

}

In: Computer Science

Hello everyone, I need to Research a Cloud Computing Service Level Agreement to describe what it...

Hello everyone, I need to Research a Cloud Computing Service Level Agreement to describe what it entails. Please point me to one that includes any of these components:

a break down of services provided and excjuled

costs for services

Duration of the agreement

Responsibilities of the customer and the service provider

In: Computer Science

Salary Raise: At the beginning of every year, you receive a raise on your previous year’s...

Salary Raise: At the beginning of every year, you receive a raise on your previous year’s salary.

Raise = Salary * Rate

Create an application that displays the amount of your annual raises and also your new salaries for the next ten years, using raise rates of 1.5%, 2%, 2.5%, 3%, 3.5%, 4%, 4.5%, 5%.

The input for the salary should come from an input box and should only allow a value between 10,000 and 100,000. Use a loop to validate the input.

In: Computer Science

Question about bat algorithm What are the main heuristics (or principles, or strategies) of the bat...

Question about bat algorithm

What are the main heuristics (or principles, or strategies) of the bat algorithm that make it works as the optimal heuristic search?

thanks

In: Computer Science

For this assignment, you will select a current research paper (published since 2016) to review. You...

For this assignment, you will select a current research paper (published since 2016) to review. You may select any research paper that is related to Data Science or Big Data Analytics. I strongly recommend that you start your search at Google Scholar . Once you enter your search term(s), select the "Since 2016" link on the left. Feel free to choose ANY relevant paper. (I would recommend that you select one that you can read and summarize in a reasonable amount of time. Don't select a 100 page paper!)

Need 200 words review on that paper

Please Don't rewrite already existing chegg answers

In: Computer Science