Programming & Computer Science Answers

C++ 9913
Python 5288
Java | JSP | JSF 3611
C 1680
C# 1362
Computer Networks 989
Algorithms 652
Databases | SQL | Oracle | MS Access 641
HTML/JavaScript Web Application 588
Other 537
Visual Basic 358
Assembler 209
Software Engineering 202
AJAX | JavaScript | HTML | PHP 166
MatLAB 150
MatLAB | Mathematica | MathCAD | Maple 124
Action Script | Flash | Flex | ColdFusion 112
UNIX/Linux Programming 89
Web Development 73
Excel 36
ASP | ASP.NET 23
Delphi | Pascal 21
Perl 16
Prolog 9
Functional Programming 9
MathCAD 5
Wolfram Mathematica 4
WPF 4
Ruby | Ruby on Rails 3
NodeJS Web Application 2

Questions answered by Experts: 26 876

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search

Write a program to keep track of a match consisting of a series of games between two people: player A and player B, and report the outcome. The input consists of a sequence of letters A or B. If the input is A, it indicates that A has won a game. If it is B, then it indicates B has won a game. The first player to win 5 or more games with a difference of 2 or more games between him and his opponent wins the match. If no player wins the match in 20 games then the match is declared a tie after these 20 games have been played.


INPUT
### The next n lines contain a char value each
c0
c1
...
cn
n ≤ 20 . ci is the outcome of the ith game. It can take a value of either A/B. A indicates that this game was won by Player A and B indicates that it was won by Player B. The input will end when a player has won according to the given rules or 20 characters have been given.

OUTPUT
At the end of the input, if player A wins, output “ A”, If player B wins output “B”. If no one has won, output “Tie”

Note: DO NOT output the quotes

Please print a newline( using “cout<<endl;” is one way to do it) after printing your answer

Write a program that takes an integer input from user and print all the possible prime numbers in that number. For example: 7523

7

5

2

3

23

523

7523


Write a program to sort above array and you are not allowed to use any condition.



Write a program to write the frequency of the number in an array of size 50 whose values are from 0 to 10.


Write a program that takes the amount from the user and tells how many denominations of the Pakistani currency 5000, 1000, 500, 100, 50, 20, 10, 5, 2, and 1. For example, 7873

5000: 1

1000: 2

500: 1

100     : 3

50: 1

20: 1

10       : 0

5         : 0

2: 1

1: 1



Write a program to keep track of a match consisting of a series of games between two people: player A and player B, and report the outcome. The input consists of a sequence of letters A or B. If the input is A, it indicates that A has won a game. If it is B, then it indicates B has won a game. The first player to win 5 or more games with a difference of 2 or more games between him and his opponent wins the match. If no player wins the match in 20 games then the match is declared a tie after these 20 games have been played.


INPUT

### The next n lines contain a char value each

c0

c1

...

cn

n ≤ 20 . ci is the outcome of the ith game. It can take a value of either A/B. A indicates that this game was won by Player A and B indicates that it was won by Player B. The input will end when a player has won according to the given rules or 20 characters have been given.


OUTPUT

At the end of the input, if player A wins, output “ A”, If player B wins output “B”. If no one has won, output “Tie”


Note: DO NOT output the quotes


Please print a newline( using “cout<<endl;” is one way to do it) after printing your answer



Write a program, which takes an array of characters from users. Your task is to check either it is palindrome or not.


Note: Palindrome is a string that reads the same from both ends. i.e. bob, mom, dad, civic.


JAVA GUI AND OOP Overview: Java Swing is a lightweight Graphical User Interface (GUI) toolkit that includes a rich set of widgets. It includes package lets you make GUI components for your Java applications, and it is platform independent. In this activity, students will have an opportunity to design a GUI of a simple java program. Instruction: Create a program that would compute for the total amount of purchase based on user preferences. Design the user interface and the source code using object-oriented programming Requirements Design the user interface of the Pizza Ordering System. Sample interface design shown below (Design your own interface but use the same tools for every section) Pizza Ordering System Date July 05. 2019 Customer Available Pizza Mountain Pizza Regular Personal O Family O Pasta Spaghetti w/ Meatballs Supreme O Meat Lovers Special Pansit Bihon Pansit Palabok O Veggie Lovers Hawaiian Sotanghon Bacon Lovers 0 Drinks Glass/Mug Pitcher Crust type Thick Additional Cheese Beef Bacon O Drum Governor Pack Road, Baguio City Contact Number: 442-3316 Thin Details Compute Total Amount Amount Due: $643.50 Discount. $0.00 Tax (22%): $181 50 Close Application Pungratumer g: Diar Terrirgar , Total Amount $825.00 Compute the total amount that the customer will pay based on the following Price List: Pizza Supreme Meat Lovers Veggie Lovers Hawaiian Bacon Lovers Personal P 350 P 300 P 250 P 275 P 275 Regular P 550 P 500 P 450 P 400 P 400 Family P 1,000 P 850 P 600 P 750 P 800 If the customer orders Family Supreme pizza, the pizza would cost P1,000.00. If the customer orders another pizza, let say Regular Hawaiian pizza, add P400 to the cost. The total amount would be P1,400.00. Also, include in the total amount the additional orders (see table below) the customer might avail. Additional Order: Food Spaghetti with Meat ball P 95 Special Pansit Bihon P 50 Pansit Palabok P 75 Sotanghon P 60 Soft drinks in: Glass/Mug P 25 Picher P 65 Р 120 Additional: Cheese P100.00 Beef 250.00 Bacon 200.00 Dum In the details area, compute for the amount due which is 78% of the computed total amount, and the Tax which is 22% of computed the total amount. Source code must be in OOP style. Create classes of each type of pizza. In each class, encapsulate the prize by creating a private attribute. Use setter and getter method to pass the prize value to main class which is your interface (JFrame). You may use a simple conditional statement for additional orders and no need for a separate class. A practice activity is given as your guide. PRACTICE ACTIVITY: 1. Create a project Pizza and add a JFrame form. 2. Create a sub class of Pizza named Supreme. 3. Add a radiobutton, label and a button By default the names of the tools are as follows JRadioButton1 , JLabell and JButton1 4. Add the following code to Supreme class (Let's say prize = 280) package pizza; public class Supreme Pizza extends PizzaJFrame { private int prize; public void setPrize ) { this.prize= 280; } public int getPrize() { return prize; } 5. Go to your JFrame Form and double click JButtonl and add following code 85 Ç 86 87 88 89 private void jButtonlActionPerformed (java.awt.event. ActionEvent evt) if (RadioButtonl.isSelected()) { Supreme Pizza pl = new Supreme Pizza (); pl.set Prize(); jLabel1.setText (Integer.toString(pl.getPrize())); }else{ JOptionPane.showMessageDialog(this, "Other Pizza Type"); } 90 91 92 93 Note: The codes shaded in gray is automatically added by netbeans. NO NEED TO ADD ANOTHER ONE. Just add the if block. 6. Test the program. Click the button while the radio button is unchecked. A message box will appear. Test it again this time check radio button and click the button. The labell must display 280.




PLEASE HELP ME WITH THIS FOR FREE. I DON'T HAVE MONEY TO PAY SO I NEED JUST HELP FOR THIS. THANKS. I WILL BE SUBMITTING IT EARLY


Define an abstract class Shape with abstract method CalculateSurface () and fields width and height. Define two additional classes for a triangle and a rectangle, which implement CalculateSurface (). This method has to return the areas of the rectangle (height*width) and the triangle (height*width/2). Define a class for a circle with an appropriate constructor, which initializes the two fields (height and width) with the same value (the radius) and implement the abstract method for calculating the area. Create an array of different shapes and calculate the area of each shape in another array


A student in Programming 1 wants to know the surface area and volume of a cylindrical shape.

Figure 5.1: Example of a cylinder

Volume = PI(R^²) x height

Area = 2PI(R^²) x height + 2PI(R^²) 

5.1.1 Write a program that will assist the students:

5.1.2Create a C++ source file called Cylinder and save it in a file called Cylinder.cpp.

5.2 Create the following functions: 

5.2.1 calcVolume() This function will receive three parameters and it must then calculate 

and return the volume of a cylinder using the information given 

above.

5.2.2 calcArea() This function will receive three parameters and it must then calculate 

and return the area of a cylinder using the information given above.

5.2.3 main() NB: The functions must be implemented above the main.

Add all necessary pre-processor directives.

 Declare all constants and necessary variables.

 Prompt the user for the height of the cylinder, and the radius of

the base of the cylinder.

 Based on the users option :

o Do the relevant calculations by calling the correct 

function.

 Display the results of the desired measurement.

 If an invalid option is selected an appropriate error message 

must be displayed, see Figure 5.5.

NB: Use a switch for the selection

o This process must be repeated until there no calculations to 

perform (N/n).

5.3 Re-write program 5.2.

5.3.1 calcValues() This function will receive four parameters and it must then calculate 

and the volume and the area of a cylinder using the information given 

above.

5.3.2 promptValues() This function will receive three parameters and it must then prompt 

the user for the required input as indicated in Figure 5.2.

5.3.3 main() NB: The functions must be implemented above the main.

Add all necessary pre-processor directives.

 Declare all constants and necessary variables.

 Prompt the user for the height of the cylinder, and the radius of 

the base of the cylinder.

 Calculation the volume and area by calling the correct 

function.

 Display the results the volume and area.


LATEST TUTORIALS
APPROVED BY CLIENTS