Questions
Use the class definition below to answer the following questions. [Total 8 Marks] public class TrafficLight...

Use the class definition below to answer the following questions. [Total 8 Marks]

public class TrafficLight {

String stopLight = "red";

String waitLight;

String goLight;

public void setStopLight(String colour) {

stopLight = colour; }

public String getGreenLight() {

return goLight; } }

1 :How many field attributes are there in the TrafficLight class?

2 :Name a field attribute for this class.

3 :What is the name of the method that is an accessor?

4 :What is the name of the method that is a mutator?

5 :What is the output type for the setStopLight method ?

6 :Write a Constructor for the TrafficLight class that sets stopLight value to “red”, waitLight to “yellow” and goLight to “green”?

In: Computer Science

(Q)Choose a DBMS that you’d like to use. Provide some evidences to show that you have...

(Q)Choose a DBMS that you’d like to use. Provide some evidences to show that you have some basic knowledge of the software. For instance, use the software to define a name and address database of your business associates, friends, classmates etc. You can use the following relation: (LAST NAME, FIRST NAME, SEX, ADDRESS, POSTCODE, CITY, PHONE). Enter at least five people in your data file. Print/screen shot a copy of the records. There should be no blank records. (20)

please mention which dbms that you used and please give detail explanation in the answer thank you.

In: Computer Science

Design a class named Person and its two subclasses named Student and Employee. Make Faculty and...

Design a class named Person and its two subclasses named Student and Employee. Make Faculty and Staff subclasses of Employee. A person has a name, address, phone number, and e-mail address. A student has a class status (freshman, sophomore, junior, or senior). Define the status as a constant. An employee has an office, salary, and date hired. A faculty member has office hours and a rank. A staff member has a title. Override the toString method in each class to display the class name and the person’s name.

Write a test program that creates objects of Person, Student, Employee, Faculty, and Staff, and invoke their toString() methods.                  

In: Computer Science

Write a client program that writes a struct with a privateFIFO name (call it FIFO_XXXX, where...

Write a client program that writes a struct with a privateFIFO name (call it FIFO_XXXX, where XXXX is the pid that you got from the getpid( ) function) to the server. Have the server read the privateFIFO name and write a message back to the client. Read the message and print it on the client side. Take screenshots of the output from your client and server programs. Send the output to Blackboard. What I'm checking for on this homework is that the name got created in the client and passed correctly to the server and the server can respond to the client. Turn the background of your window white and increase the font size.

Write in C, Will be used on Putty.

Thank you.

In: Computer Science

A coordination complex (or coordination compound) consists of a central metal ion surrounded by ions or...

A coordination complex (or coordination compound) consists of a central metal ion surrounded by ions or neutral molecules called ligands. The name of the complex specifies the number and types of ligands, as well as the name and oxidation number of the metal. Here are some common ligands and their names:

Ligand Name
Cl− chloro
F− fluoro
CO32− carbonato
O2− oxo
CN− cyano
en ethylenediamine
NH3 ammine
H2O aqua
CO carbonyl

To get an idea of how coordination complexes are named, consider the following examples:

[Pt(NH3)2(H2O)2]2+= diamminediaquaplatinum(II),

[PtCl4]2−= tetrachloroplatinate(II),

K2[PtCl4]= potassium tetrachloroplatinate(II), and

[Pt(en)2]2+= bis(ethylenediamine)platinum(II).

Notice that "platinum" becomes "platinate" only if the complex has an overall negative charge. Here are some metals and their names in complex anions.

Metal Anion name Metal Anion name
Aluminum Aluminate Iron Ferrate
Chromium Chromate Manganese Manganate
Cobalt Cobaltate Nickel Nickelate
Copper Cuprate Platinum Platinate
Gold Aurate Zinc Zincate

Similarly, copper, gold, and iron become cuprate, aurate, and ferrate, respectively, in complex anions. Also note that for the ethylenediamine ligand, en, the prefixes bis, tris, and tetrakis are used instead of di, tri, and tetra.

Part A

Name the complex ion [Cu(NH3)2(H2O)2]2+. The oxidation number of copper is +2.

Part B

Name the complex CoCl2(en)2. The oxidation number of cobalt is +2.

Part C

Name the salt [Ni(H2O)3(CO)]SO4. The oxidation number of nickel is +2.

Some ligands that have multiple donor atoms may act as monodentate or bidentate ligands, depending on the molecule. For example, although the carbonate ion CO32− has up to two donor atom sites, sometimes only one donor atom is used. You can sometimes use the coordination number of a metal ion to determine the number of donor atoms. Since cobalt(III) most frequently has a coordination number of 6, carbonate is most likely acting as a bidentate ligand in [Co(CO3)(NH3)4]3+. However, since platinum(II) has a coordination number of 4, carbonate is most likely acting as a monodentate ligand in [Pt(CO3)(NH3)3]3+.

Part E

Name the salt K4[Pt(CO3)2F2] given that the carbonate ion acts as a monodentate ligand in the complex. The oxidation number of platinum is +2.

In: Chemistry

Part 1 Ask for a file name. The file should exist in the same folder as...

Part 1

Ask for a file name. The file should exist in the same folder as the program. If using input() to receive the file name do not give it a path, just give it a name like “number1.txt” or something similar (without the quotes when you enter the name). Then ask for test scores (0-100) until the user enters a specific value, in this case, -1. Write each value to the file as it has been entered. Make sure to close the file once the user has finished entering in the data.

Specifics

You can use input() or FileUtils.selectOpenFile/FileUtils.selectSaveFile for receiving the file name from the user in either part. The FileUtils functions will be discussed in class Wednesday. The file can be downloaded from the examples folder in Blackboard. There may be LOTS of different FileUtils files available in the wild, make sure you get my file from Blackboard. Keep in mind that entering no actual data is legal (after entering a file name you enter -1 right away) and should be considered in part 1 and part 2.

Part 2 (separate program)

Ask for a file name. Don’t let the program crash if you enter the name of a file that does not exist. Detecting this will also be discussed on Wednesday. If the file doesn’t exist gracefully display an error message stating the file doesn’t exist and quit the program. It the file does exist read all the values in the file. You will only need to read the file once, or more to the point, only read the file once. After the program has finished reading all the data, display the following information to the screen: • The minimum value • The maximum value • If any values were 100. No output if no values were 100. • If any values were 0. No output if no values were 0.

• The average – display with 4 places after the decimal point • The total number of values • The total number of values greater than or equal to 75 • The total number of values less than 75

• The value closest to 75 (can be 75, less than 75 or greater than 75). abs will be useful for this value.

• The value closest to 75 WITHOUT going over 75 (can be 75, WILL NOT be greater than 75) If no data exists in the file, write out a simple message indicating that there was no data in the file and nothing else.

Requirements Complete comment section that includes your name, id number, program number and a brief description of the program

and please let me know how to file should exist in the same folder as the program to this assignment.

In: Computer Science

1.   Design a class called BankAccount. The member fields of the class are: Account Name, Account...

1.   Design a class called BankAccount. The member fields of the class are: Account Name, Account Number and Account Balance. There are also other variables called MIN_BALANCE=9.99, REWARDS_AMOUNT=1000.00, REWARDS_RATE=0.04. They look like constants, but for now, they are variables of type double
Here is the UML for the class:
                                                        BankAccount
-string accountName // First and Last name of Account holder
-int accountNumber // integer
-double accountBalance // current balance amount
+ BankAccount()                     //default constructor that sets name to “”, account number to 0 and balance to 0
+BankAccount(string accountName, int accountNumber, double accountBalance)   // regular constructor
+getAccountBalance(): double // returns the balance
+getAccountName: string // returns name
+getAccountNumber: int
+setAccountBalance(double amount) : void
+withdraw(double amount) : bool //deducts from balance and returns true if resulting balance is less than minimum balance
+deposit(double amount): void //adds amount to balance. If amount is greater than rewards amount, calls
// addReward method
-addReward(double amount) void // adds rewards rate * amount to balance
+toString(): String   // return the account information as a string with three lines. “Account Name: “ name
                                                                                                                      “Account Number:” number
                                                                                                                      “Account Balance:” balance

2.   Create a file called BankAccount.cpp which implements the BankAccount class as given in the UML diagram above. The class will have member variables( attributes/data) and instance methods(behaviours/functions that initialize, access and process data)

3.   Create a driver class to do the following:
a.   Declare and instantiate a bank account called accountZero using the default constructor
b.   Declare and instantiate a bank account called accountOne with name= “Matilda Patel” number =1232, balance=-4.00
c.   Declare and instantiate a bank account called accountTwo with name = “Fernando Diaz”, number=1234, balance=250
d.   Declare and instantiate a bank account called accountThree with name=”Howard Chen”, number=1236, balance = 194.56
e.   Display the bank accounts in the three line format as above
f.   Deposit 999 dollars in Fernando’s account and 1000.25 in Howards account
g.   Display their account information
h.   Withdraw 10000 from Matildas account and 90 dollars from Feranandos account
i.   Display the results. If withdrawal is not possible your program should say “Insufficient funds” otherwise it should say “Remaining Balance :” balance amount
j.   Print the total amount of all the bank accounts created.

In: Computer Science

1. Copy the files from Assignment 1 to Assignment 2. Relabel as necessary 2. Create 3...

1. Copy the files from Assignment 1 to Assignment 2. Relabel as necessary

2. Create 3 instances of the PetFoodCompany class - dogFoodMaker, catFoodMaker, fishFoodMaker.

3. Internally set the division name for each instance. (I.E. "Alpo" for dogFoorMaker, "Purina" for CatFoodMaker, "GloFish" for fishFoodMater)

4. Prompt me to enter the Company Name and Quarter only once.

5. For each of the above instances, prompt me for total sales and total expenses. A loop is not expected.

6. For each instance of the class, display the Company Name, Quarter. Division Name, Total Sales, Total Expenses and Net Income. The company name and quarter should be displayed for all instances.

5 Points Extra Credit: Create a method in the PetFoodCompany class that will do step 6 and call it from main() for the 3 instances.

Here is the code:

PetFoodComp.h:

class PetFoodCompany
{
public:
  
PetFoodCompany();

char getQuart();
char* getCompany();
char* getDivision();

void setQuart(char quart);
void setTotalSales(float totalSales1);
void setTotalExpences(float totalExpences1);
void setCompany(char name[]);
void setDivision(char name1[]);


float getTotalSales();
float getTotalExpences();

double netIncome();
  

private:
  
char company[40];
char division[40];

static char quart;
static double BonusRate;

float totalSales;
float totalExpences;
  
  
};

PetFood.cpp:

#include <iostream>
#include <cstring>
#include "PetFoodComp.h"

using namespace std;


double PetFoodCompany::BonusRate = 0.02;
char PetFoodCompany::quart = '1';

PetFoodCompany::PetFoodCompany()
{
   strcpy(company, "myCompanyName");
}

char PetFoodCompany::getQuart()
{
   return quart;
}

float PetFoodCompany::getTotalSales()
{
   return totalSales;
}

float PetFoodCompany::getTotalExpences()
{
   return totalExpences;
}

char* PetFoodCompany::getCompany()
{
   return company;
}

char* PetFoodCompany::getDivision()
{
   return division;
}

void PetFoodCompany::setQuart(char quart1)
{
   if (quart1 == '1' || quart1 == '2' || quart1 == '3' || quart1 == '4')
       quart = quart1;
}

void PetFoodCompany::setTotalSales(float totalSales1)
{
   totalSales = totalSales1;
}

void PetFoodCompany::setTotalExpences(float totalExpences1)
{
   totalExpences = totalExpences1;
}

void PetFoodCompany::setCompany(char name[])
{
   strcpy(company, name);
}

void PetFoodCompany::setDivision(char dname[])
{
   strcpy(division, dname);
}

double PetFoodCompany::netIncome()
{
   return (totalSales - totalExpences);
}

PetFoodMain.cpp:

#include <iostream>
#include <cstring>
#include "PetFoodComp.h"


using namespace std;

int main()
{
   double totalSales, totalExpences;
   PetFoodCompany pet;
   cout << "Company Name is " << pet.getCompany() << "\n";
   cout << "Current Quarter is " << pet.getQuart() << "\n";


   cout << "Enter Total Sales: ";
   cin >> totalSales;

   cout << "Enter Total Expences: ";
   cin >> totalExpences;

   pet.setTotalExpences(totalExpences);
   pet.setTotalSales(totalSales);

   cout << "Net Income: " << pet.netIncome() << "\n";

   return 0;
}

In: Computer Science

7. During the development of a frog's fertilized egg, the following takes place: A. Rapidly dividing...

7.

During the development of a frog's fertilized egg, the following takes place:

A.

Rapidly dividing cells lead to the formation of the "animal pole" in a region of the egg that is rich in amino acids and nucleic acids precursors.

B.

Cells divide more slowly in the "vegetal pole" as they are located in a region of the egg richer in lipids with fewer amino acids and nucleic acid precursors.

C.

In early stages of development, cells are dividing so fast that the embryo does not increase in volume.

D.

All of the above

8.

  1. Find the incorrect description.

    A.

    Light Microscopy — Usually has a resolution of 0.2 µm and a maximum magnification of 1000X. Light goes through the specimen. It usually requires staining of specimens (cells, tissue slices)

    B.

    Confocal Microscopy — Allows visualization of cells in three dimensions because it takes images in optical sections and integrates them using computer power.

    C.

    Atomic Force Microscopy — Similar in principle to light microscopy, but uses an electron beam instead of photons. Enlargement up to 106X and resolution of biological specimens about 1 nm.

    D.

    Fluorescence Microscopy — Excitation light is absorbed by fluorescent probes in the specimen and reemitted at a lower energy, i.e., a longer wavelength.

9.

  1. During titration of glycine with HCl, what is the proportion of +H3N–CH2–COO /+H3N–CH2–COOH at pKa1?

    A.

    75%/25%

    B.

    0%/100%

    C.

    50%/50%

    D.

    25%/75%

11.

  1. Consider the compound pairs below:

    1. HCHO, CH3CHO (formaldehyde, acetaldehyde)
    2. CH4, CH3CH3 (methane, ethane)
    3. HCOOH, CH3COOH (formic acid, acetic acid)
    4. CH3OH, CH3CH2OH (methanol, ethanol)
    5. CO2, CO (carbon dioxide, carbon monoxide)

    What is their correct order, from the most oxidized to the most reduced?

    A.

    v > iii > i > iv > ii

    B.

    i > iv > ii > v > iii

    C.

    i > ii > iii > iv > v

    D.

    v > iv > iii > ii > i

In: Biology

BUCK FILTER TRANSFER FUNCTION (CCM) USING MATLAB I. State-space Modelling and Transfer Function of Ideal Buck...

BUCK FILTER TRANSFER FUNCTION (CCM) USING MATLAB

I. State-space Modelling and Transfer Function of Ideal Buck Converter

1. Write the AC state-space for an ideal Buck Converter under CCM, given
the state-variables iL^(t) and vc^(t),
input variables d^(t) and vs^(t), and
output variables iL^(t) and vc^(t).

2. Create the state-space model in Matlab using R=5/3 ohms, L=10 uH, C=242 uF, Vs=Vin= 20 V, Vo = 5 V, D=5/20

3. Extract the transfer functions from the state-space model.
vo^(s)/vs^(s),
vo^(s)/d^(s),
iL^(s)/vs^(s),
iL^(s)/d^(s)

4. Write the expressions for the transfer functions.

5. Plot the pole-zero maps, step-responses, and Bode plots of the transfer functions.

II. State-space Modelling and Transfer Function of Buck Converter with Parasitics

1. Write the AC state-space for an ideal Buck Converter under CCM, given
the state-variables iL^(t) and vc^(t),
input variables d^(t) and vs^(t), and
output variables iL^(t) and vo^(t).

2. Create the state-space model in Matlab using R=5/3 ohms, L=10 uH, C=242 uF, Vs=Vin = 20 V, Vo = 5 V, D=5/20, rL=25mohm, rC=25mohm

3. Extract the transfer functions from the state-space model.
vo^(s)/vs^(s),
vo^(s)/d^(s),
iL^(s)/vs^(s),
iL^(s)/d^(s)

4. Write the expressions for the transfer functions.

5. Plot the pole-zero maps, step-responses, and Bode plots of the transfer functions.

In: Electrical Engineering