Questions
This is in Java 1. Create an application called registrar that has the following classes: a....

This is in Java

1. Create an application called registrar that has the following classes:

a. A student class that minimally stores the following data fields for a student:

Name

 Student id number

 Number of credits

 Total grade points earned            

And this class should also be provides the following methods:

 A constructor that initializes the name and id fields

 A method that returns the student name field

 A method that returns the student ID field

 Methods to set and retrieve the total number of credits

 Methods to set and retrieve the total number of grade points earned.

 A method that returns the GPA (grade points divided by credits)

b. An instructor class that minimally stores the following data fields for an instructor:

Name

 Faculty id number

 Department
The following methods should be provided:

 A constructor that initializes the name and id fields

 Methods to set and retrieve the instructor’s department.

c. A course class that minimally stores the following data for a course:

Name of the course

 Course registration code

 Maximum number of 50 students

 Instructor
 Number of students

 Students registered in the course (array)
The following methods should also be provided

 A constructor that initialize the name, registration code, and maximum number of students

 Methods to set and retrieve the instructor

 A method to search for a student in the course; the search should be based on an ID number.

 A method to add a student to the course.

 A method to remove a student from the course.

In: Computer Science

#Problem 2 Write function write_stock that asks the user to input a company name, its associated...

#Problem 2

Write function write_stock that asks the user to input a company name, its associated ticker symbol (eg. Exxon, XOM), and the price per share of the stock. These are then written to file stock.txt one item per line. The user will type in ‘quit’ to stop.

Write function get_share_value that accepts a company name and the number of shares. The function will search file stock.txt and return a list of two values; the ticker symbol and the total value of the shares. This function must use an exception handler to insure the file is valid, that the price can be converted to a number, and catch any other exception that might be raised.

Write a program that calls write_stock and get_share_value. The program will ask the user for the company name and number of shares for read_stock and print the answer.

Sample output might look as follows.

Enter company name; enter quit to stop: Amazon

Enter ticker symbol: amzn

Enter price: 1000

Enter company name; enter quit to stop: Apple

Enter ticker symbol: aapl

Enter price: 125

Enter company name; enter quit to stop: Microsoft

Enter ticker symbol: msft

Enter price: 250

Enter company name; enter quit to stop: quit

What stock did you buy?: Apple

How many shares?: 10

Your total value for aapl is $1250.00

PYTHON CODE

In: Computer Science

C++ please Instructions Download and modify the Lab5.cpp program. Currently the program will read the contents...

C++ please

Instructions

Download and modify the Lab5.cpp program.

Currently the program will read the contents of a file and display each line in the file to the screen. It will also display the line number followed by a colon. You will need to change the program so that it only display 24 lines from the file and waits for the user to press the enter key to continue.

Do not use the system(“pause”) statement.

Download Source Lab 5 File:

#include <iostream>

#include <string>

#include <iomanip>

#include <fstream>

using namespace std;

int main()

{

ifstream file; // File stream object

string name; // To hold the file name

string inputLine; // To hold a line of input

int lines = 0; // Line counter

int lineNum = 1; // Line number to display

// Get the file name.

cout << "Enter the file name: ";

getline(cin, name);

// Open the file.

file.open(name);

// Test for errors.

if (!file)

{

// There was an error so display an error

// message and end the program.

cout << "Error opening " << name << endl;

}

else

{

// Read the contents of the file and display

// each line with a line number.

while (!file.eof())

{

// Get a line from the file.

getline(file, inputLine, '\n');

// Display the line.

cout << setw(3) << right << lineNum

<< ":" << inputLine << endl;

// Update the line display counter for the

// next line.

lineNum++;

// Update the total line counter.

lines++;

}

// Close the file.

file.close();

}

return 0;

}

In: Computer Science

Java assignment, abstract class, inheritance, and polymorphism. these are the following following classes: Animal (abstract) Has...

Java assignment, abstract class, inheritance, and polymorphism.

these are the following following classes:

Animal (abstract)

  • Has a name property (string)
  • Has a speech property (string)
  • Has a constructor that takes two arguments, the name and the speech
  • It has getSpeech() and setSpeech(speech)
  • It has getName and setName(name)
  • It has a method speak() that prints the name of the animal and the speech.

o Example output: Tom says meow.

Mouse

  • Inherits the Animal class
  • Has a constructor takes a name and also pass “squeak” as speech to the super class
  • Has a method chew that takes a string presenting the name of a food.

o Example output: Jerry is chewing on cheese.

Cat

  • Inherits the Animal class
  • Has a constructor takes a name and also pass “meow” to the super class
  • Has a method chase that takes a Mouse object.  

o Example output: Tom is chasing Jerry.

TomAndJerry

  • Has a static method makeAnimalSpeak that takes an Animal object and makes it animal speak.
  • Has a main method that
    • Create a variable of Animal type and assign it a mouse named “Jerry”
    • Create a variable of Animal type and assign it a cat named “Tom”
    • all the method makeAnimalSpeak on the animals you have created
    • Make the mouse chew on “cheese”
    • Make the cat chase the mouse

Sample run:

Jerry says squeak.

Tom says meow.

Jerry is chewing on cheese.

Tom is chasing Jerry.

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

this code still shows that it still has an syntax error in it can you please...

this code still shows that it still has an syntax error in it can you please fix it. I will put an error message next to the line that is wrong and needs fixed, other than that the other lines seems to be ok.

public static void main()
{
/**
* main method - makes this an executable program.
*/
public static void main("String[]args"); this is the error line that I get and needs fixed
// create a client with placeholder values
system.out.println("Client with default information");
// create a client object using first constructor
Client client1 = new Client();
  
  
// Display information about the client
System.out.println(client1.toString());
  
System.out.println();
System.out.println("Create a client by providing information");
// client last name - Jameson
// client first name - Rebecca
// client age - 32
// client height - 65
// client weight - 130
Client client2 = new Client("Jameson", "Rebecca",
32, 65, 130);
  
// Display information about the client
System.out.println(client2.toString());

// Display the first name
System.out.println("original first name = " +
client2.getFirstName());
  
// set the first name to the value Rachel
client2.setFirstName("Rachel");
  
// Retrieve and dislplay the client first name
System.out.println("new first name = " +
client2.getFirstName());
  
// Display information about the client
System.out.println(client2.toString());

// set their weight to 180
client2.setWeight(180);
  
// Display information about the client
System.out.println(client2.toString());
}

}

In: Computer Science

Assignment Description Write a program that will have a user guess whether a person is a...

Assignment Description

Write a program that will have a user guess whether a person is a musician or a writer. You will create a

group of four names, two musicians and two writers, and show the user a name randomly selected from

the four. The user will then guess whether they think the name belongs to a musician or writer. After a

guess, the program will tell the user whether they are correct, repeat the name, and reveal the correct

answer.

Tasks

1) The program needs to contain the following

a.

A comment header containing your name and a brief description of the program

b. At least 5 comments besides the comment header explaining what your code does

c.

Four string variables, two musicians and two writers

d. A way to randomly display one of the four names to the user

e. Output asking the user whether the name displayed is a musician or a writer

i. If the user guesses correctly, congratulate them before outputting the displayed

name and the correct answer

ii. If the user guesses incorrectly, output the displayed name and the correct

answer

f.

“Press enter to continue” and Console.Read(); at the end of your code

2) Upload the completed .cs file onto the Assignment 3 submission folder. To access the .cs file:

a.

Right click on your program tab

b. Click “Open containing folder”

c.

The file you are working on will be there with a .cs extention, upload the .cs file


please code in C#- (C Sharp)

In: Computer Science

Part (a) CREATE TWO TABLES IN MICROSOFT ACCESS: (1) A Customer Table which includes the following...

Part (a) CREATE TWO TABLES IN MICROSOFT ACCESS: (1) A Customer Table which includes the following fields: Customer Name, Customer Address, and Credit Limit. (Note: All customers have a $40,000 credit limit). (2) A Sales Invoice table which includes the following fields: Customer Name, Salesperson, Date of Sale, Invoice Number, Amount of Sale. Part (b): Run the following queries: Query 1: List all sales between 10/20/2014 and 11/20/2014 that were greater than $2,500. Include in your query the customer name, date of sale, invoice number, and amount of sale. List the sales in alphabetical order by customer name. Query 2: List total sales by each salesperson for October and November 2014 in descending order. Include in your query the salesperson name and amount of total sales. Query 3: List the total sales by customer in descending order. Include in your query the customer name, customer address, and amount of total sales per customer. Query 4: List the remaining credit available for each customer. Include in your query the customer name, customer address, credit limit, amount of total sales per customer, and remaining credit available for each customer in descending order of remaining credit available.

In: Computer Science

A)A bomb calorimeter, or constant volume calorimeter, is a device often used to determine the heat...

A)A bomb calorimeter, or constant volume calorimeter, is a device often used to determine the heat of combustion of fuels and the energy content of foods.
Since the "bomb" itself can absorb energy, a separate experiment is needed to determine the heat capacity of the calorimeter. This is known as calibrating the calorimeter.
In the laboratory a student burns a 0.392-g sample of bisphenol A (C15H16O2) in a bomb calorimeter containing 1140. g of water. The temperature increases from 25.00 °C to 27.40 °C. The heat capacity of water is 4.184 J g-1°C-1.
The molar heat of combustion is −7821 kJ per mole of bisphenol A.

C15H16O2(s) + 18 O2(g) ------>15 CO2(g) + 8 H2O(l) + Energy

Calculate the heat capacity of the calorimeter.
heat capacity of calorimeter =_________ J/°C

B)

A bomb calorimeter, or a constant volume calorimeter, is a device often used to determine the heat of combustion of fuels and the energy content of foods.

In an experiment, a 0.5574 g sample of benzil (C14H10O2) is burned completely in a bomb calorimeter. The calorimeter is surrounded by 1.379×103 g of water. During the combustion the temperature increases from 26.36 to 28.99 °C. The heat capacity of water is 4.184 J g-1°C-1.
The heat capacity of the calorimeter was determined in a previous experiment to be 847.1 J/°C.
Assuming that no energy is lost to the surroundings, calculate the molar heat of combustion of benzil based on these data.
C14H10O2(s) + (31/2) O2(g) ------->5 H2O(l) + 14 CO2(g) + Energy
Molar Heat of Combustion = _________ kJ/mol



C)

A bomb calorimeter, or a constant volume calorimeter, is a device often used to determine the heat of combustion of fuels and the energy content of foods.

In an experiment, a 0.9900 g sample of β-D-fructose (C6H12O6) is burned completely in a bomb calorimeter. The calorimeter is surrounded by 1.292×103 g of water. During the combustion the temperature increases from 21.82 to 24.12 °C. The heat capacity of water is 4.184 J g-1°C-1.
The heat capacity of the calorimeter was determined in a previous experiment to be 991.1 J/°C.
Assuming that no energy is lost to the surroundings, calculate the molar heat of combustion of β-D-fructose based on these data.
C6H12O6(s) + 6O2(g) -------> 6 H2O(l) + 6 CO2(g) + Energy
Molar Heat of Combustion = ____________ kJ/mol


All three problems are a set for one question on my homework, so please answer all three. Thank you so much!

In: Chemistry

Experiment 2 – Light Independent Reaction After the light dependent reaction, the light independent takes place....

Experiment 2 – Light Independent Reaction

After the light dependent reaction, the light independent takes place. During this phase, also known as the Calvin Cycle, the energy generated in the light independent phase is used to fixate the carbon atoms from carbon dioxide and glucose is produced.

In this experiment you will use baby spinach leaves to demonstrate the utilization of carbon dioxide during the light independent reaction of photosynthesis. Phenol red is an organic dye that undergoes a color change according to pH . The color of this compound will appear as follows:

Because phenol red can be used to detect changes in pH, it can also be used as an indirect method of detecting changes in the amount of CO2 dissolved in a solution. When CO2 is added to a solution, some of it reacts with water to produce an acid called carbonic acid. In turn, some of the carbonic acid dissociates to increase the [H+] in the solution. Therefore, if the amount of CO2 in a solution is increased, the [H+] increases (pH is lowered) and the solution becomes more acidic. It also follows that if the amount of CO2 in a solution is lowered (e.g., by removal of CO2 from the solution), the [H+] will decrease (pH increases) and the solution becomes more basic. The chemical reactions involved are shown below.

To detect the process of carbon fixation (CO2 reduction), you will use this pH indicator to detect changes in the CO2 level.

Materials

Fresh spinach leaves

2 glass test tubes

2 - 250 ml beakers

Phenol red solution

Permanent marker or wax pencil

Water *

Sunshine or bright light source *

Stopwatch/timer

Metric ruler

Procedure

Add 20 ml of phenol red solution to 2 glass test tubes.

With your straw , blow bubbles over the top of the solution until it turns yellow. The color change occurs when the water in the phenol red solution and the CO2 are combined forming carbonic acid . Make sure that both tubes are the same shade of yellow.

Add a small leaf of baby spinach to tube 2 only

Place the 2 test tubes into sunshine or a bright light at time for 2 hours.

Record the color every ½ hour.

Table 2: Change is Color (phenol red)

0 time

½ hour

1 hours

1 ½ hours

2 hours

Tube 1

Tube 2

Questions

What is the independent variable in this experiment?

What is the dependent variable in this experiment?

What happened to the color of the solution over time?

What is the process that is occurring to make the phenol red solution change colors?

What is the function of the following components in the process of photosynthesis (this may differ than how this compounds were used in the experiment)

CO2:

Light:

H2O:

O2:

Chloroplasts:

In: Biology