Draw a flowchart and write pseudo code for a program that will accept marks for 10 students who sat for a java examination. Total mark for the examination is 80. Determine if the mark is a pass or a fail. This process should be done until all students marks have been captured..
Total mark is 80
10 students
CS 1102 Unit 5 – Programming Assignment
In this assignment, you will again modify your Quiz program from the previous assignment. You will
create an abstract class called "Question", modify "MultipleChoiceQuestion" to inherit from it, and add a
new subclass of "Question" called "TrueFalseQuestion".
This assignment will again involve cutting and pasting from existing classes. Because you are learning
new features each week, you are retroactively applying those new features. In a typical programming
project, you would start with the full suite of features, enabling you to re-use code in ways natural to
Java and avoid cutting and pasting.
Recall the following scenario discussed during the class. Develop a code base to represent the scenario. Add a test class to invoke Lecturer and Student class by creating atleast one object from each.
Note: All the common attributes and behavior stored in the super class and only the specific fields and behavior stored in subclasses.
Student
- name
- id
- course
+ setName()/getName()
+ setID()/getID()
+ setCourse()/getCourse()
Lecturer
- name
- id
- programme
+ setName()/getName()
+ setID()/getID()
+ setProg()/getProg()
Person
Identify field and attributes to be stored in this class
Develop the following class execute and discuss the answer: Please note that each class stored in separate files. Write down the answer.
class SuperB {
int x;
void setIt (int n) { x=n;}
void increase () { x=x+1;}
void triple () {x=x*3;};
int returnIt () {return x;}
}
class SubC extends SuperB {
void triple () {x=x+3;} // override existing method
void quadruple () {x=x*4;} // new method
}
public class TestInheritance {
public static void main(String[] args) {
SuperB b = new SuperB();
b.setIt(2);
b.increase();
b.triple();
System.out.println( b.returnIt() );
SubC c = new SubC();
c.setIt(2);
c.increase();
c.triple();
System.out.println( c.returnIt() ); }
}
Ground Beef Value Calculator Different packages of ground beef have different percentages of fat and different costs per pound. Write a program that asks the user for: 1. The price per pound of package "A" 2. The percent lean in package "A" 3. The price per pound of package "B" 4. The percent lean in package "B" The program then calculates the cost per pound of lean (nonfat) beef for each package and writes out which is the best value. INPUT Enter Price per pound package A: 2.89 Percent lean package A: 85 Price per pound package B: 3.49 Percent lean package B: 93 OUTPUT Package A cost per pound of lean:3.4 Package B cost per pound of lean:3.75 Package A is the best value Assume that the two packages will not come out equal in value. Note: the output of the program above should be formatted to 2 decimal places using the method System.out.printf(). Note: Use if and switch Control statement Format of Answer 1. Code 2. Screenshot of codes in editor 3. Output
logic inside the forloop to test ifthe number is between 90 and 100 If the number is in this range, then it should add 1 to the tally ofgradeA. You should have another test to see if the number is between 80&89 and if it should add 1 to the tally of gradeBYou should continue to have tests for 70 to79 being gradeC60 69 being graded& below 60 being gradeF. After the for loop thendisplay a list ofhow many students had A's B'setc. in the output message box.If the data is 90 100 80 85 63 73 80 92 90The display should be like that: Create algorithmpseudocodeflowchartCreate counter variables for each letter grade.Create conditional statements to determine the number of A’s B’sC’s D’s and F’sCriteria:Grade AScore is between 90(inclusive)and100(inclusive)Grade BScore is between 80(inclusive)and 90(not inclusive)Grade CScore is between 70 (inclusive)and80(not inclusive)Grade DScore is between 60(inclusive)and 70(not inclusive)Grade FScore is below 60Print the counts for each grade in one message box.
Draw a flowchart and write pseudo code for a program that will accept marks for 10 students who sat for a java examination. Total mark for the examination is 80. Determine if the mark is a pass or a fail. This process should be done until all students marks have been captured.. [20 Marks]
Marking Key:
-Correct flowchart symbols – 4 marks
-Correct flowchart logic – 6 marks
-Correct syntax of the pseudocode– 4 marks
-Correct pseudocode logic – 4 marks
Draw a flowchart and write pseudo code for a program that allows a student to enter his/her name, student number, sex arid age. If the age is below 18 years, the program should reject the student, otherwise the student is allocated class LBIS12O1 if they are male, else they are allocated to LBIS12O2. The program prints the details of the student and informs him/her which class they are allocated. Write the pseudocode for the same problem
Draw a flowchart and write pseudo code for furniture company program; the program determines the price of a table. Ask the user to choose 1 for pine, 2 for oak or 3 for mahogany. The output is the name of the wood chosen as well as the price of the table. Pine table costs P100, oak tables cost P225, and mahogany tables cost P310.If the user enters an invalid code, set the price t
Write a Program that will ask the user to accept an integer input and outputs message below:
Choose what you want to print:
1. Print Hello Philippines
2. Print Numbers Ascending (from 1)
3. Print Numbers Descending (from 1000)
Enter the number that you want to print:
Number of iterations:
output here: