1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
mina [271]
4 years ago
13

Write a programto add two fractions and display the

Computers and Technology
1 answer:
klemol [59]4 years ago
5 0

Explanation:

Program to add two fractions

Add two fraction a/b and c/d and print answer in simplest form.

Examples :

Input: 1/2 + 3/2

Output: 2/1

Input: 1/3 + 3/9

Output: 2/3

Input: 1/5 + 3/15

Output: 2/5

You might be interested in
What are the six things you will learn this week on Scratch?
notka56 [123]

Answer:

1 You can learn to draw

2 You can learn to code

3 You can learn to make a thumbnail

4 You can learn how to follow yourself

5 You can learn  to remix your own projects

6 You can learn how to make a featured project you've never shared

Explanation:

8 0
3 years ago
The two primary methods of memory allocation are:
levacccp [35]

Answer:

The answer is

Stack and heap

4 0
3 years ago
Consider the following code segment which makes use of the list deck and the positive integer i: Which of the following could be
ANEK [815]

Answer: A) Steve Andrew Kevin

B) Alex Joe Matt C) Sally Heather Barbie D) Tim Tim Tim

Explanation:

6 0
3 years ago
Write a modular program that allows the user to enter a word or phrase and determines whether the word or phrase is a palindrome
Ostrovityanka [42]

Answer:

import java.util.Scanner;

public class num10 {

   public static void main(String[] args) {

       Scanner in = new Scanner(System.in);

       System.out.println("Enter a word");

       String word = in.nextLine();

       String reversed = "";

       //Get the length of the string entered

       int length = word.length();

       //Loop through the string and reverse th string

       for ( int i = length - 1; i >= 0; i-- )

           reversed = reversed + word.charAt(i);

       //Compare the two strings "word" and "reversed"

       if (word.equals(reversed))

           System.out.println(word+" is a palindrome");

       else

           System.out.println(word+" is not a palindrome");

   }

}

Explanation:

Since we know that a palindrome word is a word that reads the same forward and backward, The Idea here is:

  • To obtain a word from a user.  
  • Use a for loop to reverse the word and store in another variable
  • Use if....else to compare the two strings and determine if they are equal, if they are equal then the word is palindrome.
6 0
4 years ago
Pseudocode of creating a program to convert to IEEE 754 to a real number
Eduardwww [97]

Answer:

  • Step1: Check If the number is Positive or Negative.  
  • Step2: If it is positive then save the sign of it as 0.  
  • Step3: If it is negative then save the sign of it as 1.
  • Step4: Covert the negative number to Positive.
  • Step5: Convert the IEEE 754 to Binary.
  • Step6: convert the integer part into binary form  
  • Step7: Convert fractional part into binary form
  • Step8: To convert Integer part, Devide the number by 2 and note down the reminder and Keep deviding unless dividend is less than 2
  • Step9: copy all the reminders together
  • Step10: Multiply decimal part by 2 unless fractional part is 0.
  • Step11: By noting down integral part, keep multiplying decimal part by new value of 2 untill perfect number is reached.
  • Step6: Find the Mantissa.
  • Step7: Concatinate the Sign, exponent and the mantissa.

Explanation:

For Example : 20.75

First step (converting 50 (in base 10) to binary):

  • No is Positive
  • By dividing 20 by 2, which gives 10 with no remainder 0.
  • Now Devide 10 by 2, which gives 5 with a remainder of 0.
  • Now Devide 5 by 2, which gives 2 the reminder as 1
  • Now Devide 2 by 2, which gives 1 with reminder as 0
  • Now devide 1 by 2, which gives 0 with reminder as 1
  • We read the result from bottom to top  which is 10100

Second part is to convert 0.75 to binary:

  • We have to multiply 0.75 by 2, which gives 1.5. We keep only the integer part, which is 1.  
  • Now, we do 1.5 - 1, which gives 0.5. Now, We multiply 0.5 by 2, which gives 1.  
  • Now we do 1 - 1, which gives 0.
  • Reading from Top to bottom will give 110

Final Answer is : 10100.110

8 0
3 years ago
Other questions:
  • Please help I’ll give you 10 points
    8·2 answers
  • Which of the following technologies allows you to decouple the physical storage hardware from the storage requirements of the ap
    6·1 answer
  • As Assembly language code runs on a CPU invoking functions and using the stack, it is clear that CPU registers are
    8·1 answer
  • You are working on a program that needs to keep track of many values at the same time. Which of the following would you use?
    10·2 answers
  • What are the special features of fifth generation that makes it different from the other generations?​
    9·1 answer
  • Can you defeat all 3 Daughters Of Lerion at a 98 power level in Assassin's Creed Valhalla? Its part of the mysteries column. whe
    11·2 answers
  • ? Question<br> How are the Internet and the World Wide Web different from each other?
    11·1 answer
  • What is wrong here??
    14·1 answer
  • Which statement best describes the computers all around us?
    15·1 answer
  • On a cdma (code division multiple access) network, how are mobile handsets identified by the carrier?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!