Write a program to determine the class type of a War Ship. Given the following
scale:
Class_ID
Class_type
B or b
Battleship
Cor c
Cruiser
D or d
Destroyer
For f
Trigate
Other values of Class_ID will displayed output "Not a War Ship".
Input the Class_ID and display its Class_Type
Build a pseudocode for scenario an MCQ Assignment sheet of Descriptive Statistics to finish before tomorrow morning. the sheet only includes only 1 type of Question but with Different data fields in each question.
Question - Distance of top of bars from X-axis is given to you. Plot the Graph for given data and find the Volume of Graph that can be filled with any fluid.
You don't want to do the same calculation so many times since you're short on time. So you decide to write an algorithm that calculates the Volume of a graph.
Note - Assume an elevetion Graph where width of each bar is 1.
Instruction: Create a program plan, algorithm, flowchart and pseudocode for the following cases:
A Department Store classifies its credit card holders as to local, national and international. A local card holder resides in Metro Manila, a national, anywhere in the Philippines and an international, anywhere in the world. The programmer must store a code 01, 02, and 03 for local, national and international card holders respectively. The program is to read the cards and store the proper code in each card.
Create Program Plan, Algorithm, and Flowchart. An electric company bases its charges on two rates, customers are charged P 25.00 per kilowatt-hour for the first 300 kilowatt-hours used in a month and P 30.00 each for all kilowatt-hours used thereafter. Compute for the amount due from a customer after reading the kilowatt-hours used. Assume that there are 100 records of customers.
Write an Program Plan, Algorithm and draw a flowchart that will convert a given decimal number (N10) to its equivalent Binary number (N2).
Given is GROSS_PAY, draw a program plan, algorithm, and flowchart that will compute for DEDUCTIONS and NET_PAY for employee’s weekly Payroll. Consider the conditions:
If Civil Status = ‘SINGLE’
DEDUCTIONS = GROSS_PAY * 0.03
If Civil Status = ‘MARRIED’
DEDUCTIONS = GROSS_PAY * 0.06
If Civil Status = ‘WIDOW’
DEDUCTIONS = GROSS_PAY * 0.05
If Civil Status = HEAD OF THE FAMILY’
DEDUCTIONS = GROSS_PAY * 0.02
Using the formula:
[NET_PAY = GROSS_PAY – DEDUCTIONS]
Create Program Plan, Algorithm, and Flowchart
A company classifies its products by weights as follows:
Class A – 12 pound or over
Class B – 5 to 11.9 pounds
Class C – less than 5 pounds
Show the logic of determining into which class to place an item.
Given is GROSS_PAY, draw a flowchart that will compute for DEDUCTIONS and NET_PAY for employee’s weekly Payroll. Consider the conditions:
If Civil Status = ‘SINGLE’
DEDUCTIONS = GROSS_PAY * 0.03
If Civil Status = ‘MARRIED’
DEDUCTIONS = GROSS_PAY * 0.06
If Civil Status = ‘WIDOW’
DEDUCTIONS = GROSS_PAY * 0.05
If Civil Status = HEAD OF THE FAMILY’
DEDUCTIONS = GROSS_PAY * 0.02
Using the formula:
(Use Big O to calculate the following time complexity)
Q 1
def printPairs(array):
for i in array:
for j in array:
print(str(i)+","+str(j))
Q2
def printUnorderedPairs(array):
for i in range(0,len(array)):
for j in range(i+1,len(array)):
print(array[i] + "," + array[j])
#Question3
def printUnorderedPairs(arrayA, arrayB):
for i in range(len(arrayA)):
for j in range(len(arrayB)):
if arrayA[i] < arrayB[j]:
print(str(arrayA[i]) + "," + str(arrayB[j]))
arrayA = [1,2,3,4,5]
arrayB = [2,6,7,8]
DRAW A FLOWCHART USING THIS ALGORITHM
Start
Take input ( a decimal number like ‘a ‘)
Start the loop (for (i=0 ;i>1 ;i++))
Apply following calculation inside loop
ar[i]=a%2
a=a/2
Outside loop
ar[i]=a
start loop again for print (for (j=i; j>=0; j—) )
Out ar[j]
End