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

Input


The four numbers


Description


N/A


Constraints


N/A


Sample


N/A


Output


The first four lines will contain message prompts to input the four numbers.

The last line will contain the sum of all positive numbers with two decimal places.


Enter·the·first·number:·12.1

Enter·the·second·number:·-321

Enter·the·third·number:·53.3

Enter·the·fourth·number:·-34

Sum·of·all·positive·numbers·=·65.40


Input


The first number, second number, third number, fourth number and fifth number contains:


Description

N/A


Constraints

This may be a decimal number.


Sample

N/A


Output


The first line will contain a message prompt to input the first number.

The second line will contain a message prompt to input the second number.

The third line will contain a message prompt to input the third number.

The fourth line will contain a message prompt to input the fourth number.

The fifth line will contain a message prompt to input the fifth number.

The last line contains the sum of all negative numbers rounded off and displayed with 2 decimal places.


Enter·the·first·number:·34

Enter·the·second·number:·43.5

Enter·the·third·number:·-53.24

Enter·the·fourth·number:·56.3

Enter·the·fifth·number:·-10.32

Sum·of·all·negative·integers·=·-63.56


Execute this code with THREE pushes and ONE pop
stack<int> s;
s.push(1);
s.push(2);
s.push(3);
cout << s.pop( );
Suppose that s is represented by a linked list. Draw the state of the private member
variables of s after the above code:
_______
head_ptr| |
|_______|
Execute this code with THREE pushes and ONE pop:
stack<int> s;
s.push(1);
s.push(2);
s.push(3);
s.pop( );
Suppose that s is represented by a partially filled array. Draw the state of the private
member variables of s after the above code:
_______ __________________________________
used| | data| | | | | |
|_______| |______|______|______|______|______|
[0] [1] [2] [3] [4]
The Linked List contains certain Nodes containing data of integer type, You cannot use any
other type of Array or data structure neither doubly Linked List. Use only singly linked list,
Implement a function which can reverse the List. Write down the code take dummy data to
test and take snap shot to show output paste it in document.
Int to Stack: Given a non- negative integer, Parse the integer and push it in a stack
then push to another stack in such a way that while storing all numbers should be
in ascending order. Store in back to unsigned integer in the order they can be
popped, it will give you a new integer.
The rules of the are:
 The only permitted ADT is stack.
 Stack rules should not be violated
 You are not permitted to use and store data in any other variable other than
the variable storing initial non- negative number
 You can use than variable to store the final result.
 The variable storing non-negative number is not allowed to use again to store
any numbers
Hint:
 Unsigned int x = 69815
 Parse and Store in stack as |6|9|8|1|5|
 Sorted numbers |1|5|6|8|9|
 Unsigned int x = 98651
I drink a lot of coke.I place the empty cans in a series of stacks, all in a straight line. When I view this series of stacks from the front, I can’t always see all the cans, or even all of the stacks, because sometimes a stack can be entirely obscured by a larger stack. When I view the series of stacks from the front, I can infer a minimum number of total cans. I can see each stack that is strictly larger than all the stacks between it and the front of the structure. For each stack I can see, I know how many cans are used to construct that stack. I then total up the number of cans that I know must exist: let’s call this number A. I then say I infer A cans in this structure.Suppose a series of stacks has the following stack sizes, in order from the front to the back: {1, 4, 3, 4, 6, 6, 2}. I’m able to infer 11 cans from this series: I can see the first, second, and fifth stacks (with 1, 4 and 6 cans respectively).Can you write a program that takes a series of stacks, and tells me how many cans I can infer?

Add a subclass named Finance_Period that will determine if a customer will pay interest or not. If the number of months to pay for the product is greater than three, the customer will pay 25% interest, else no interest applies. The maximum number of months to pay for the product is 12. Override the calculate_repayment () method by determining if the customer will pay interest or not and calculate the monthly repayment amount.


Create a class called Customer_Finance that contains the logic to test the two classes. Prompt the user for data for the first object where no interest applies and display the results; then prompt the user for data where interest is applicable and display the results.


10% discount to children who are not more than 12 years old or senior citizens who are at least 65 years old. It is further stated that ONLY those who are visiting the Park for at least the 5th time will qualify for this discount

public class KrugerNationalPark {

public static void main(String[] args){

String Age, Visit;

Age = 18;

Visit = 10;

decideDiscount(Age, Visit);

}

public static void decideDiscount(double A, char V)

{

if ((A <= 12 && >= 65) && (V >= 5));

System.out.print("You qualify for 10% discount!")

System.out.print("You deserve it!")

else

System.out.print("You do not qualify for discount")

}

}

 

the program is not executing due to at least 10 syntax errors.

1) You are required to debug the program and re-write the program without errors.

2) Re-write your program in such a way that method decideDiscount() can return a value to the calling method. The calling method will then display if a customer qualifies for a discount or not.



2. Write a java program named StampCalc.java. This program will input 3 int values from the command-line. The first will represent the number of First Class stamps requested, the second number will indicate the number of Additional Ounces needed for those first class letters, and the third number will indicate the number of International stamps requested.


The cost for First Class stamps is $.50, the cost for an Additional Ounce is $.21, and the cost for an International stamp is $1.15.


Your program will calculate the total cost for the requested number of stamps.


If the command-line values were: 5 2 6


Your output should show just one line:


The total for 5 First Class stamps, 2 additional ounces and 6 International stamps is $9.82




LATEST TUTORIALS
APPROVED BY CLIENTS