Give a brief review on the evolution in computer generations. A common application of the fifth generation is the Expert system. Describe how it can be applied in the medical field.
In: Computer Science
Difference between array and list? Explain in your own words.
In: Computer Science
Difference between stacks and queues? Explain in your own words.
In: Computer Science
First, the Python program prompts user to enter user information (name, email, and phone number). Then it displays a menu called “Fish Information” that has the following fish type:
1. Cat Fish 2. Red Fish 3. Any other fish
Let user choose the fish type that he/she got and input the length of the fish. Then the program will determine what should be done with this particular fish. Based on the following criteria:
Criteria: Length:
FISHTYPE - Cat Fish <10: "throw back" >=10 through <=25: "keep" >25: "tag"
FISHTYPE – Red Fish <15: "throw back" >=15 through <=30: "keep" >30: "tag"
FISHTYPE – any other fish <10: "throw back" >=20: "keep"
Let the user to enter as many times they want using loops and save all the input data using List.
At the end, the program will display the user’s information and all the fish information.
In: Computer Science
A company has three salespeople (1 to 3) who sell five different products (1 to 5). Once a day, each saleperson passes in a slip for each type of product sold. Each slip contains the following: a) The salesperson number b) The product number c) The total dollar value of that product sold that day Thus, each salesperson passes in between 0 and 5 sales slips per day. Assume that the information from all of the slips for last month is available. You are required to write a C# program that will read all the information for last month’s sales and summarize the total sales by salesperson and by product. All sales data should be stored in a two-dimensional array sales. After processing all the information for last month, display the results in tabular format, with each column representing a particular salesperson and each row representing a particular product. Cross-total each row to get the total sales of each product for last month. Cross-total each column to get the total sales by salesperson for last month. You tabular output should include these cross-totals to the right of the totaled rows and below the totaled columns.
A sample output is as follows:
Enter sales person number (-1 to end): 1
Enter product number: 100
Enter sales amount: 1000
Invalid input!
Enter sales person number (-1 to end): 1
Enter product number: 1
Enter sales amount: 100
Enter sales person number (-1 to end): 1
Enter product number: 3
Enter sales amount: 200
Enter sales person number (-1 to end): 1
Enter product number: 5
Enter sales amount: 300
Enter sales person number (-1 to end): 2
Enter product number: 2
Enter sales amount: 400
Enter sales person number (-1 to end): 2
Enter product number: 4
Enter sales amount: 500
Enter sales person number (-1 to end): 3
Enter product number: 1
Enter sales amount: 600
Enter sales person number (-1 to end): 3
Enter product number: 2
Enter sales amount: 700
Enter sales person number (-1 to end): 3
Enter product number: 3
Enter sales amount: 800
Enter sales person number (-1 to end): -1
Product Salesperson 1 Salesperson 2 Salesperson 3 Total
1 $100.00 $0.00 $600.00 $700.00
2 $0.00 $400.00 $700.00 $1,100.00
3 $200.00 $0.00 $800.00 $1,000.00
4 $0.00 $500.00 $0.00 $500.00
5 $300.00 $0.00 $0.00 $300.00
Total $600.00 $900.00 $2,100.00
In: Computer Science
What structure would you select if a customer came and said, I want to have a program where I would be updating the data (I would be putting more data in) and later I want to retrieve in their initial order (I want to get them out in the order they were inserted). What would the most sufficient structure to do that? Explain in your own words.
In: Computer Science
Suppose I have a 32 bit register containing 0000AC12 in hex and I do a logical shift >>2. What hex digits will result from the binary shift? Be sure to show all 32 bits in hex
In: Computer Science
Write a Java program that reads words from a text file and displays all the non-duplicate words in ascending order. The text file is passed as a command-line argument.
Command line argument: test2001.txt
Correct output:
Words in ascending order...
1mango
Salami
apple
banana
boat
zebra
In: Computer Science
In: Computer Science
Write a program that will write the contents of a text file backwards one character at a time. Your program should first ask for the text file name to be processed – and after verifying that the file exists, it should read the file into a StringBuilder buffer. Save the new file using the old filename appended with “Ver2-“ at the front. So for the file “MyStuff.txt” the file would be saved as Ver2-MyStuff.txt”. You can use any text file to test your work.
In: Computer Science
What kind of information can a hacker get from a good packet sniffer program?
How could packet sniffing be used in a good way or positive benefits?
In: Computer Science
I have a python program that must check if an integer is the sum of the squares of four consecutive prime numbers. However, when I run the program, it goes into an infinite while loop, and it doesn't give me any answer. I can only use the while, if, else, True and False commands. The code I'm using is
n1=2
n2=3
n3=5
n4=7
n = int(input("n: "))
if (n==(n1**2)+(n2**2)+(n3**2)+(n4**2)):
print(n1,n2,n3,n4)
else :
i = 2
pr = True
next = n4 + 2
while next <= n:
while i < next and pr == True:
if next%i == 0:
pr = False
else :
pr = True
i=i+1
if pr == True:
n1 = n2
n2 = n3
n3 = n4
n4 = next
if (n==(n1**2)+(n2**2)+(n3**2)+(n4**2)):
print(n1,n2,n3,n4)
else:
next = next + 2
if (next>n):
print("false")
And it only works with the number 87, since it's outside the while loop
In: Computer Science
................................................
................................................
This programming lab assignment requires that you create a class and use an equals method to compare two or more objects. Your should use your QC5 as a reference.
…………………………...……..
…………………………...…….
Instructions
LAB5 Instructions
Using QC5 as a model, create a Rectangle class and a CompareUsingequalsMethod class that uses an equals Method to determine if two rectangles are equal if and only if their areas are equal. The Rectangle class should have two instance variables length and width.
Your submission to BB should be your “Rectangle.java” and “CompareUsingequalsMethod.java” files only, not included in a .zip file or a .gpj file.
..............................................................
.............................................................
QC5
Circle.java
/**circle class*/
public class Circle{
//fields
private int radius;
//constructor
public Circle(int radius){
this.radius = radius;
}
//methods
public int getRadius() {
return radius;
}
public boolean equals(Circle inC1, Circle inC2){
if(inC1.getRadius() == inC2.getRadius())
return true;
else
return false;
}
}
…………………………………………….
…………………………………………………………..
CompareUsingequalsMethod.java
/**Demos using the equals method*/
public class CompareUsingequalsMethod{
public static void main(String[] args){
Circle circle1 = new Circle(3);
Circle circle2 = new Circle(3);
Circle circle3 = new Circle(5);
if (circle1.equals(circle1,circle2)) {
System.out.println(" Circle1 with radius " + circle1.getRadius()
+
" is equal to circle2 with radius " + circle2.getRadius());
}
else{
System.out.println(" circle1 with radius " + circle1.getRadius() +
" Radius is not equal to circle2 with radius " +
circle2.getRadius());
}
if(circle3.equals(circle3,circle2)) {
System.out.println(" Circle3 with radius" + circle3.getRadius()
+
" is equal to circle2 with radius" + circle2.getRadius());
}
else{
System.out.println(" circle3 with radius " + circle3.getRadius() +
" Radius is not equal to circle2 with radius " +
circle2.getRadius());
}
}
}
In: Computer Science
I am stuck on this Java problem:
Create an Animal class with:
Create a Dog Class
Create a Cat Class
In: Computer Science
Lab 2
∑={0,1} L = {w : if |w| is odd w begins with 11}.
List the indistinguishability classes for L(M). Include the following information for each class c, where wc is a string in c:
• A short description or characteristic function that describes the strings in c.
• Whether wc is or is not in L(M).
• ∀z(wcz ∈ L(M) iff … ). This rule must be different for each equivalence class — that is what makes them different classes.
• The class transitions for each symbol in Σ: wca ∈ [na] and Σ: wcb ∈ [nb], where na and nb are the numbers of equivalence classes.
In: Computer Science