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

Profit or Loss

The amount at which a product is sold by the seller is known as the Selling Price. The amount at which the seller has acquired the product is known as the Cost Price.

If the Selling Price of a product is higher than its cost price, then the seller has made a profit. If it is lesser, then the seller has incurred loss selling that product. If the Selling Price is equal to the Cost Price, it means the seller has made No Profit and No loss, by selling the product.

Given Cost price

CP and selling price SP of a product, write a program to determine whether the seller made a profit, incurred loss, or made no profit or loss. Input

The first line is an integer

CP. The second line is an integer SP.Output

Print

Profit or Loss or No Profit - No Loss based on CP and SP.Explanation

In the given example,

CP = 143,SP = 155, So as the selling price is higher than the cost price, the output should be Profit.

Sample Input 1

143

155

Sample Output 1

Profit

Sample Input 2

165

125

Sample Output 2

Loss




3-digit Armstrong Number

Write a program to check if a given 3-digit number X is an Armstrong number or not.


Note: A number is an Armstrong number if the number is equal to the sum of the Nth power of its digits.


Input

The first line is an integer X.


Output

The output should be a single line containing True if it satisfies the given conditions, False in all other cases.


Explanation

In the given example X = 371,

The number of digits in 371 is 3.


So, 33 + 73 + 13 = 371. Hence, 371 is an Armstrong number.


So, the output should be True.


Sample Input 1

371

Sample Output 1

True

Sample Input 2

351

Sample Output 2

False




* Make an application with the above classes(invoice,item,itemQuantity,storage) for a client that comes with a list of items * that needs to purchase with the following ruleset: - At the beginning at least 5 different types of items must be added to the storage (use the method addItemQuantity() from Storage.class) - Then create a list of items of the client. - For every item first should be checked if the items are available (use getItemQuantity of Storage.class) - If an item is unavailable do not include it in the invoice - If the item is available include it in the invoice - After all the items are added to the invoice, show all the items added with the description, quantity and cost of the item. This final list should be shown ordered in alphabetical order. - output the invoice into a text file (invoice.text) and save it on the local PC.


Create an employee form that accepts an employee number, employee name, employee surname, employee department, gender, and salary. The form should insert the employee details in the employee database. Include a table that fetches the employee’s details from the database, deletes and updates these details on a table.


Create an employee form that accepts an employee number, employee name, employee surname, employee department, gender, and salary


Using suitable examples, briefly explain functions of the five components of this
network adapter.

Write pseudocode, design flow chart and Java program using meaningful variable names, match logic specificed as in pseudocode and flow chart. Collect client information (Last name, first name, middle name (appear in one line) house/unit number, street name, type (appear in one line, city (by itself) & age (by itself) . Initial of first name with full stop, initial of middle name with full stop. Age brackets: 20 or under

21-35

36-70

71 or over


 LOOP: (TURBOc++)



 

Prg15: Write a program that displays a multiplication table for a given number.

Sample output:      Enter a number: 3

                              Multiplication table for 3:

 3 x 0 = 0

3 x 1 = 3

3  x 9 =27



PLEASE USE:

#include<stdio.h>

#include<conio.h>


scanf

printf

 


example:

#include<stdio.h>

#include<conio.h>

main()

{

int n=1, x=20;

clrscr();

printf("While Loop Example");


while (n<=5)

{

gotoxy(x, 3);printf(" %d", n);

n++;x=x+5;

}

getch();

}


 LOOP: (TURBOc++)


PRG14. Write a program that will accept 10 numbers, identify if the number is odd or even, then finds the sum of all odd numbers, all even numbers, and total of all the numbers entered.

 


PLEASE USE:

#include<stdio.h>

#include<conio.h>


scanf

printf

 


example:

#include<stdio.h>

#include<conio.h>

main()

{

int n=1, x=20;

clrscr();

printf("While Loop Example");


while (n<=5)

{

gotoxy(x, 3);printf(" %d", n);

n++;x=x+5;

}

getch();

}


 LOOP: (TURBOc++)



Prg16: Program that accepts a number then output the sum of the squares from 1 to n.

Enter a number : 4

1^2 + 2^2 + 3^2 + 4^2 = 30


PLEASE USE:

#include<stdio.h>

#include<conio.h>


scanf

printf

 


example:

#include<stdio.h>

#include<conio.h>

main()

{

int n=1, x=20;

clrscr();

printf("While Loop Example");


while (n<=5)

{

gotoxy(x, 3);printf(" %d", n);

n++;x=x+5;

}

getch();

}


LATEST TUTORIALS
APPROVED BY CLIENTS