C program:
1, Make two parallel arrays, one to keep track of food names and
another to keep track of the food prices. There will be a total of
10 items, with a total of about 100 characters for each food name
title (i think we can use malloc for the strings and allocate it
accordingly)
Basically it will be something like a menu:
1, we will enter the food information
2, it will list all the food names and prices
3,then it will show a total value of the food inventory
Thanks!
To clarify, this is basically an inventory tracking. The user is the one inputting the food names, like for example the user inputs Donut and the price for Donut $3.00 that would be tracked, then the user enters 9 more items+ their prices(this is where the parallel array comes in). giving us 10 food items in the inventory.
In: Computer Science
How do you simplify the following boolean expressions:
Y3= X3' X2 X1 X0' + X3' X2 X1 X0 + X3 X2 X1 X0' +X3X2X1X0
Y2 = X3' X2 X1' X0' + X3' X2 X1' X0 + X3 X2 X1' X0' + X3 X2 X1' X0 + X3 X2' X1' X0' + X3 X2' X1' X0 + X3 X2' X1 X0' + X3 X2' X1 X0
Y1 = X3' X2' X1 X0' + X3' X2' X1 X0 + X3' X2 X1 X0' + X3' X2 X1 X0 + X3 X2' X1' X0' + X3 X2' X1' X0 + X3 X2 X1' X0' + X3 X2 X1' X0
Y0 = X3' X2' X1' X0 + X3' X2' X1 X0 + X3' X2 X1' X0 + X3' X2 X1 X0 + X3 X2' X1' X0 + X3 X2' X1 X0 + X3 X2 X1' X0 + X3 X2 X1 X0
In: Computer Science
#1) What is shunning (in network term)?
#2) Using iptables, in which chain would you create rules to block all outgoing traffic not meeting certain exceptions?
Please explain clearly and WILL BE UPVOTED!!!
In: Computer Science
What two clocks are contained in the 6811 microprocessor?
In: Computer Science
Using Java, write the the following code. Only the bold needs to be answered
Here is the driver:
package assign
public class A3Driver {
public static void main(String[] args) {
//Test GSUStudent object
GSUStudentWorker gsw = new GSUStudentWorker("Bunny","Bugs", 2000, 9, 8, 9001234);
gsw.setGPA(3.7);
gsw.setHourlyRate(10.00);
gsw.setTotalHours(30);
System.out.println(gsw);
GSUStudentWorker gsw2 = new GSUStudentWorker("Bunny","Betty", 1999, 9, 8, 9002413);
gsw2.setGPA(4.0);
gsw2.setHourlyRate(10.00);
gsw2.setTotalHours(45);
System.out.println(gsw2);
//Test GSUStoreSupervisor
GSUStoreSupervisor gss = new GSUStoreSupervisor("Duck","Daffy", 1980, 9, 8);
gss.setMonthlyPay(4000);
System.out.println(gss);
//test GSUSuperStudent
GSUSuperStudent gsuper = new GSUSuperStudent("Mouse","Minny", 1990, 9, 8, 9004321);
gsuper.setGPA(3.9);
gsuper.setHourlyRate(10.00);
gsuper.setTotalHours(30);
gsuper.setMonthlyPay(4000);
System.out.println(gsuper);
}
}
1. The Person class
a. Person is an abstract class.
b. All class variables of the Person class must be private.
c.is a class with a single constructor, Person(String lName, String fName, int birthYear, int birthMonth, int birthDay). All arguments of the constructor should be stored as class variables. There should only be getter methods for first and last name variables. There should be no getters or setters forbirthYear, birthMonth, birthDay.
The method computeAge() takes no arguments and returns the person’s computed age (as of today's date) as a string of the form "X years, Y months and Z days". Hint: Use the LocalDate and Period classes.
i. e.g. "21 years, 2 months and 3 days". ii. e.g. "21 years and 3 days".
iii. e.g. "21 years and 2 months". iv. e.g. "21 years".
v. e.g. "2 months and 3 days".
The toString method returns a string comprised of the results of
getFname, getLName and computeAge. E.g.
i. “Bunny Bugs is 19 years and 1 day old”
The equals method returns true if the name and date of birth of this person and the other person are the same, otherwise return false.
2. The Employee interface
a.has a single method, getPay(), which returns a
double
representing the pay earned for the period in dollars and cents.
3. The MonthlyEmployee interface
a. This interface extends the Employee interface.
b. has a single void method, setMonthlyPay(double perMonth),
which
takes a double as an argument. The argument is the amount earned for the month in dollars and cents.
4. The HourlyEmployee interface
a. This interface extends the Employee interface.
b. has a void method, setHourlyRate(double perHour), which takes
a
double as an argument. The argument is the amount earned for
each hour that the employee works.
c. has a void method, setTotalHours(double hoursWorked),
which
takes a double as an argument. The argument is the total hours worked for the week.
Has a final integer variable MAX_WEEKLY_HOURS, which is assigned
a value of 40. This variable is used to assess if the total
hours worked exceeds the mandated hours.
Has a final double variable OVERTIME_RATE, which is assigned a
value of 1.75. This variable is used to compute the pay amount for hours worked that exceeds the mandated hours.
5. The Student class
a. The Student class is abstract.
The Student class extends the Person class.
All (if any) class variables of the Student class must be private.
has an abstract void method, setGPA(double gpa), which takes a double as an argument. The argument is the grade point average of the student using a 4.0 scale.
has an abstract method, getGPA(), which returns a double. The returned value is the grade point average of the student using a 4.0 scale.
6. The GSUStudentWorker class
a. The GSUStudentWorker class extends the Student class and
inherits from the HourlyEmployee interface.
is a class with a single constructor, GSUStudentWorker (String lName, String fName, int birthYear, int birthMonth, int birthday, int eid). There should be a getter and setter for eid, which is the Eagle ID of the student.
All class variables of the Student class must be private.
has a void method, setGPA(double gpa), which takes a double as an argument. The argument is the grade point average of the student using a 4.0 scale.
has a method, getGPA(), which returns a double. The returned value is the grade point average of the student using a 4.0 scale.
f. Has a toString() method that returns a string in the form shown below.
i. Bugs Bunny is 19 years and 15 days old and is a Great Sauce student with a 3.7 GPA who earned $300.00 this week.
7. The GSUStoreSupervisor class
a. The GSUStoreSupervisor class extends the Person class and
inherits from the MonthlyEmployee interface.
is a class with a single constructor, GSUStoreSupervisor(String lName, String fName, int birthYear, int birthMonth, int birthDay).
All class variables of the Student class must be private.
Has a toString() method that returns a string in the form shown below.
i. Daffy Duck is 39 years and 15 days old and is a Great Sauce monthly employee who earned $4000.00 this period.
8. The GSUSuperStudent class
a. GSUSuperStudent has found a way to get paid as a monthly
employee and as a student employee.
The GSUSuperStudent class extends the GSUStudentWorker class and inherits from the MonthlyEmployee interface.
All class variables of the Student class must be private.
Has a toString() method that returns a string in the form shown below.
i. Minny Mouse is 29 years and 15 days old and is a Great Sauce student with a 3.9 GPA who earned $4300.00 this period.
Example output:
__________Example from A3Driver shown below
Bugs Bunny is 19 years and 15 days old and is a Great Sauce student with a 3.7 GPA who earned $300.00 this week.
Betty Bunny is 20 years and 15 days old and is a Great Sauce student with a 4.0 GPA who earned $487.50 this week.
Daffy Duck is 39 years and 15 days old and is a Great Sauce monthly employee who earned $4000.00 this period.
Minny Mouse is 29 years and 15 days old and is a Great Sauce student with a 3.9 GPA who earned $4300.00 this period.
In: Computer Science
JAVA PROGRAM
Create a Binary Search Tree with the following elements in the order mentioned below:
5, 85, 89, 3, 2, 8, 65, 92
Print the Pre-order of this tree
Print the height and the balance factor of the nodes in the order they were inserted (5, 85, 89, 3, 2, 8, 65, 92) in the form of a table with three columns and 9 rows. Use column headers “Node”, “Height”, and “Balance Factor” for the three columns respectively. Use the following table as reference for your output. Don't worry about printing the table borders. Note: You are not balancing the tree. You are just computing the heights and balance factors of a BST.
Node Height Balance Factor
2 0
65 0
92 0
8 1
89 1
85 2
3 1
5 3
In: Computer Science
Explain line-by-line what the following snippet code from a .htaccess (WordPress) file means:
RewriteEngine On
RewriteBase /
RewriteRule ^wp-admin/includes/ - [F,L]
RewriteRule !^wp-includes/ - [S=3]
RewriteRule ^wp-includes/[^/]+\.php$ - [F,L]
RewriteRule ^wp-includes/js/tinymce/langs/.+\.php - [F,L]
RewriteRule ^wp-includes/theme-compat/ - [F,L]
In: Computer Science
Create a 300–400 word report outlining the following:
In: Computer Science
Embedded computer systems:
Configure and code clock for Pic24e referring to the example C code given below.
a) Write code on how to configure bits that uses its fast RC oscillator with PLL to run at 40MHz. Assume the RC's frequency is 7.5MHz.
b) Write code on how to configure bits that uses its primary crystal (XT) with PLL to run at 40MHz. Assume the external clock is a crystal oscillator of 8MHz.
====== Given C Code =======
#include "ConfigurationBits.h"
void initializeSystem() {
// Configure the device PLL to obtain 60 MIPS operation. The crystal
// frequency is 8MHz. Divide 8MHz by 2, multiply by 60 and divide by
// 2. This results in Fosc of 120MHz. The CPU clock frequency is
// Fcy = Fosc/2 = 60MHz.
PLLFBD = 58; /* M = 60 */
CLKDIVbits.PLLPRE = 0; /* N1 = 2 */
CLKDIVbits.PLLPOST = 0; /* N2 = 2 */
/* Initiate Clock Switch to Primary
* Oscillator with PLL (NOSC= 0x3)*/
__builtin_write_OSCCONH(0x03);
__builtin_write_OSCCONL(0x01);
while (OSCCONbits.COSC != 0x3);
// Wait for PLL to lock
while (OSCCONbits.LOCK != 1);
}
In: Computer Science
4. What is ZooKeeper? Who developed it? Describe its main functions.
In: Computer Science
Write a C program in Unix which uses a function called search to find
the location of a value in THREE arrays of floats. The function should
take three parameters :
the value to be found
the array to be searched
the size of the array
N.B.!!!! The main program should read in three arrays of varying size
example : array a has twelve elements
array b has six elements
array c has nine elements
array d has four elements
input to these arrays terminated by illegal input(see handout)
the function should return for each array the index where the
value is found. If not found the function should return -1.
In: Computer Science
JAVA
Stack - Implementation.
You will be able to use the push, pop and peek of Stack concept. Post-Fix calculator - When an arithmetic expression is presented in the postfix form, you can use a stack to evaluate the expression to get the final value. For example: the expression 3 + 5 * 9 (which is in the usual infix form) can be written as 3 5 9 * + in the postfix. More interestingly, post form removes all parentheses and thus all implicit precedence rules.
Program Implementation Requirements
Use the stack concept to create a post-fix calculator. I will be using a test-harnessPreview the document to run your program. Please make sure it meets the requirements to be run by the test harness.
Test harness:
public class StackCalcTest {
public static void main(String[] args) {
StackCalc stackCalc = new StackCalc();
String[] values = {"3", "5", "9", "*", "+"};
for(int i = 0; i < 5; i++) {
stackCalc.stack.push(values[i]);
}
System.out.println(stackCalc.stack);
System.out.println(stackCalc.answer()); }}
In: Computer Science
I need unique answer, NO COPY PLEASE!
What is a Database key?
Explain various types of database keys (Super key, Candidate key, Primary key and Foreign key) with your clear definitions/ideas and at least one appropriate example for each one of them.
In: Computer Science
In C ++, Design and implement a program that reads from the user four integer values between 0 and 100, representing grades. The program then, on separate lines, prints out the entered grades followed by the highest grade, lowest grade, and averages of all four grades. Format the outputs following the sample runs below.
Sample run 1:
You entered: 95, 80, 100, 70
Highest grade: 100
Lowest grade: 70
Average grade: 86.25
In: Computer Science
After downloading the workbook example source-code for Microsoft Visual Studio 2015-2017 Community Ed., and installing, configuring, and running Visual Studio with ASP.NET developers kit, develop and construct an APA formatted paper (also use LIRN (or JSTOR), Internet, and the textbook) that provides a detailed analysis of the following concepts:
The importance and proper of data validation for applications
The use of state(s), object(s) and their relationship to ASP.NET
Strategies for the use and implementation of master pages to enhance content
Implementation and use of Bootstrap in ASP.NET and strategies for generating HTML dynamically to enhance default styles
Advantages of using the FriendlyUrls feature in automating applications
The use of ADO.net in database programming
In: Computer Science