Question

ASSIGNMENT ONE Instruction: for each of the following question, write a pseudocode to show the solution to the problem descri
0 0
Add a comment Improve this question Transcribed image text
Answer #1

1)

Pseudocode:

cost_price= input()

selling_price = input()

if cost_price< selling_price

{

print( "The seller has made a profit")

proft= selling_price- cost_price

print("The profit = "+profit)

}

else if cost_price> selling_price

{

print( "The seller has incurred a loss")

loss= cost_price- selling_price

print("The loss = "+loss)

}

else{

print("No loss, No Profit.")

}

2.

n= input()

if n%2 = 0 // i.e it gives remainder 0 on division with 2

{

print("number is an even number")

}

else{

print("number is an odd number")

}

Add a comment
Know the answer?
Add Answer to:
ASSIGNMENT ONE Instruction: for each of the following question, write a pseudocode to show the solution...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Question 4 (3 mark) : Write a Java program to ask the user to input an...

    Question 4 (3 mark) : Write a Java program to ask the user to input an integer number from the keyboard. The output should indicate whether it is positive, zero, or negative, an even number or an odd number. REQUIREMENTS • Your code should ask user to input an integer number, then decide its sign and parity based on this input. • Your code should use if-else statement. Your code must work exactly as the specification and the output should...

  • programming language: C++ *Include Line Documenatations* Overview For this assignment, write a program that will simulate...

    programming language: C++ *Include Line Documenatations* Overview For this assignment, write a program that will simulate a game of Roulette. Roulette is a casino game of chance where a player may choose to place bets on either a single number, the colors red or black, or whether a number is even or odd. (Note: bets may also be placed on a range of numbers, but we will not cover that situation in this program.) A winning number and color is...

  • Write an application (SpaceDigits) that: (in java) a. inputs one number consisting of five digits from...

    Write an application (SpaceDigits) that: (in java) a. inputs one number consisting of five digits from the user, separates the number into its individual digits and prints the digits separated from one another by three spaces each. For example, if the user types in the number 42339, the program should print “4 2 3 3 9.” (Hint: The number input is five digits long, dividing it by 10000 gives the leftmost digit. digit1 = number / 10000 ) b. determines...

  • Requirement Write pseudocode and translate it to ONE C-program for each the following problems. In your...

    Requirement Write pseudocode and translate it to ONE C-program for each the following problems. In your pseudocode and C-program, use only what you have learned in this class so far. (Menu) Design a menu for question 2 and 3. So far, you use one program to solve all lab questions. But some of you may feel awkward when you want to demo/test only one lab question. To overcome that, your program should show a menu so that the users of...

  • Use program control statements in the following exercises: Question 1 . Write pseudocode for the following:...

    Use program control statements in the following exercises: Question 1 . Write pseudocode for the following: • Input a time in seconds. • Convert this time to hours, minutes, and seconds and print the result as shown in the following example: 2 300 seconds converts to 0 hours, 38 minutes, 20 seconds. Question 2. The voting for a company chairperson is recorded by entering the numbers 1 to 5 at the keyboard, depending on which of the five candidates secured...

  • Language is Python 3, please include comments Question 1 Write function collatz, that takes a positive...

    Language is Python 3, please include comments Question 1 Write function collatz, that takes a positive integer x as input and prints the Collatz sequence starting at x. A Collatz sequence is obtained by repeatedly applying this rule to the previous number x in the sequence: 3/2 if x is even 3.2 +1 if x is odd. Your function should stop when the sequence gets to number 1. Note: It is an open question whether the Collatz sequence of every...

  • Java Switch Case Make From Pseudocode

    The following pseudo-code describes a menu-driven algorithm:loopask the user to input one of the characters a, b, c, d, e, q read in a character from the keyboardif the character is'a' output your name and your tutor's name (hard-coded) 'b' input 3 double numbers x, y, z and output the largestand the smallest of the three numbers'c' input 2 integer numbers m and n, and display all thenumbers between m and n (both inclusive) with five numbers per line (note...

  • in C++ Path: P Words:0 QUESTION 29 Write the code that allows you to input one...

    in C++ Path: P Words:0 QUESTION 29 Write the code that allows you to input one number and print whether it is even or odd. Include variable declarations. Your variable should be your first name. You will lose points for a different variable name. TTTT Paragraph • Arial • 3 (12pt) %0DQ TT, Of Mashups HTML CSS Path:p Words: 0 Click Save and Submit to save and submit. Click Save All Answers to all misters Sa

  • Question is two parts In R(Programming language). Define and write a function which takes one number...

    Question is two parts In R(Programming language). Define and write a function which takes one number as input and detects whether the number is even. Return TRUE if it is even, and FALSE otherwise. You need to first detect if the input is an integer; if not, return NA. Note 1: TRUE and FALSE are logical values, not strings! Note 2: No need to get user input from the console. Test your function using your_function_name(1), your_function_name(2), and your_function_name(1.5). Hint: What...

  • Use both pseudocode and flowcharts to solve the problems below: 1. Write a program that converts...

    Use both pseudocode and flowcharts to solve the problems below: 1. Write a program that converts a user-entered Fahrenheit temperature to equivalent Celsius temperature. Use the formula c = (5 / 9) * (f - 32) where c is representing a Celsius temperature and f a Fahreinheit temperature. 2. A program is required that will read two operands and print the product to a file. 3. A program will ask the user to enter his/her name. Upon entering the name...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT