Construct flowcharts and algorithms for the following problems: 1. Convert a decimal number into its equivalent binary, octal, or hexadecimal form according to the given option.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
100%
EXERCISES
Construct flowcharts and algorithms for the following problems:
1. Convert a decimal number into its equivalent binary, octal, or
hexadecimal form according to the given option.
2. Test whether a given string is a palindrome.
3. Count the number of vowels, consonants, and special characters in a
given string.
4. Unscramble a four-letter word.
[Hint. Let abcd be the given four-character string. The process should
find out all the words by jumbling the characters, such as acbd and
adbc.]
5. Convert a given Roman numeral into its decimal equivalent. The fol-
lowing table gives the Roman numerals and their decimal equivalents:
Roman
Decimal
M
1000
D
500
C
100
50
X
10
V
I
1
The algorithm for converting a Roman numeral
R1, R2, ..Rn
to a decimal is given below:
1. I+1
(I denotes the position of the symbol being scanned)
2. DECIMAL+ 0
DECIMAL is to hold the decimal value of the given Roman numeral)
3. REPEAT steps 4 through 6 WHILE I < N.
4. If the decimal value of R, is greater than or equal to the decimal
value of R,, add the decimal value of R, to DECIMAL else subtract
the decimal value of R, from DECIMAL.
5. COMPUTE I– I + 1.
6. END-WHILE.
+1
Transcribed Image Text:EXERCISES Construct flowcharts and algorithms for the following problems: 1. Convert a decimal number into its equivalent binary, octal, or hexadecimal form according to the given option. 2. Test whether a given string is a palindrome. 3. Count the number of vowels, consonants, and special characters in a given string. 4. Unscramble a four-letter word. [Hint. Let abcd be the given four-character string. The process should find out all the words by jumbling the characters, such as acbd and adbc.] 5. Convert a given Roman numeral into its decimal equivalent. The fol- lowing table gives the Roman numerals and their decimal equivalents: Roman Decimal M 1000 D 500 C 100 50 X 10 V I 1 The algorithm for converting a Roman numeral R1, R2, ..Rn to a decimal is given below: 1. I+1 (I denotes the position of the symbol being scanned) 2. DECIMAL+ 0 DECIMAL is to hold the decimal value of the given Roman numeral) 3. REPEAT steps 4 through 6 WHILE I < N. 4. If the decimal value of R, is greater than or equal to the decimal value of R,, add the decimal value of R, to DECIMAL else subtract the decimal value of R, from DECIMAL. 5. COMPUTE I– I + 1. 6. END-WHILE. +1
7. ADD the decimal value of R, to DECIMAL.
8. PRINT DECIMAL.
9. STOP.
6. Convert a decimal number into its Roman equivalent.
7. Show that Goldback's conjecture in mathematics is true for all the
positive even numbers under 500.
(Goldback stated that every even integer greater than 2 can be expressed
as the sum of two prime numbers.)
8. The maximum and the minimum temperatures on each day of a city
are collected over each month and then processed to determine
(i) average minimum temperature of the month
(ii) average maximum temperature of the month
(iii) lowest temperature during the month and the day number on
which it occurred
(iv) highest temperature during the month and the day number of the
month on which it occurred
9. Obtain the sum and the difference of two matrices.
10. A fishing fleet fishes in 10 different regions each consisting of 8 differ-
ent areas. The data about the fish caught in kilograms are available for
processing. Determine
(i) region-wide average amount of fish caught
(ii) area-wide average amount of fish caught
(iii) the area of the region that yielded the highest catch
(iv) the area of the region that yielded the lowest catch
(v) grand total of the fish caught
Show the data in a tabular format.
Transcribed Image Text:7. ADD the decimal value of R, to DECIMAL. 8. PRINT DECIMAL. 9. STOP. 6. Convert a decimal number into its Roman equivalent. 7. Show that Goldback's conjecture in mathematics is true for all the positive even numbers under 500. (Goldback stated that every even integer greater than 2 can be expressed as the sum of two prime numbers.) 8. The maximum and the minimum temperatures on each day of a city are collected over each month and then processed to determine (i) average minimum temperature of the month (ii) average maximum temperature of the month (iii) lowest temperature during the month and the day number on which it occurred (iv) highest temperature during the month and the day number of the month on which it occurred 9. Obtain the sum and the difference of two matrices. 10. A fishing fleet fishes in 10 different regions each consisting of 8 differ- ent areas. The data about the fish caught in kilograms are available for processing. Determine (i) region-wide average amount of fish caught (ii) area-wide average amount of fish caught (iii) the area of the region that yielded the highest catch (iv) the area of the region that yielded the lowest catch (v) grand total of the fish caught Show the data in a tabular format.
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Computational Systems
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education