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 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 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 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.
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.
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.
Consider the compound pairs below:
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 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
The Henry Keizer Family Foundation (2016) provides an excellent resource for individuals to assess their knowledge about health insurance. Do you think that these types of resources are a part of improving quality?
In: Operations Management
"What are the seven different types of financial institutions? Include a description of the main services offered by each." (Cornett, Adair, & Nofsinger, 2016). Distinguished-level: Provide a definition of the term, liquidity.
In: Finance
Oklahoma Law Review Volume 68 Number 3 2016 “Big Data” and the Risk of Employment Discrimination. Raise your concern on employement discrimination through the use of big data.
In: Operations Management
Refer to the T-note and T-bond quotes in Table 6-1
a. What is the asking price on the 2.750 percent November 2023 T-bond if the face value of the bond if the face value bond is $10,000 ?
b. What is the bid price on the 0.500 percent August 2016 T-note if the face value of the bond is $10,000
(For all requirements, round your answer to 2 decimal places. (e.g., 32.16))
a. The Ask price ______
b. The Bid price ______
Maturity. Coupon Bid. Asked Chg. Asked Yield
11/15/2023 2.750 107.5234 107.5391 0.0703 1.673
8/31/2016 0.500 100.0391 100.0547 0.0234 0.296
In: Finance
Solve the following problems: Using the balance sheet below:
Balance Sheet Accounts of SimpleTec Corporation
Account Balance 12/31/2013 Balance 12/31/2014
Accumulated Depreciation $2,030 $2,680
Accounts Payable $1,810 $2,070
Accounts Receivable $2,490 $2,700
Cash $1,310 $1,100
Common Stock $5,000 $5,000
Inventory $5,810 $6,040
Long-Term Debt $7,810 $8,210
Plant, Property & Equipment $8,410 $9,210
Retained Earnings $1,380 $1,100
In: Finance