Can you create diagrams using Visual Paradigm or equivalent UML software to create Class and Object Diagrams showing their relationship using the program that I uploaded?
Can you create diagrams using Visual Paradigm or equivalent UML software to create Class and Object Diagrams showing their relationship using the program that I uploaded?
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
Related questions
Question
Can you create diagrams using Visual Paradigm or equivalent UML software to create Class and Object Diagrams showing their relationship using the program that I uploaded?
![Main.java x
import java. lang.*;
public class Main{ I
2
//Add various methods to perform different arithme tic operations
public int add(int a, int b){
return a * b;
7
public int sub(int a, int b) {
return a - b;
10
11
public int mul(int a, int b) {
return a * b;
12
13
}
public int div(int a, int b){
if(b == 0){
System.out.println("Dividing value can not be zero! ") ;
14
15
16
17
return 0;
18
19
else{
20
return a/ b;
21
22
}
23
24
public int exp(int base, int expo)
{
25
26
int pow = 1;
//increase the value of i for each iteration
27
for (int i = 1; i <= expo; i++)
//power calculation
28
29
30
pow = pow * base;
//returns power
31
32
return po;
}
33
34
public double cuberoot (int a) {
return Math.cbrt(a);
35
36
37
38
39
// Declare main class to create object of the class and call its methods
40
public static oid main(String[] args){
//Create object or the Cal class
Main c = new Main();
41
42
43
// Call one by one methods of the class and print the results
System.out.println("Addition: "+c.add(5,10));
System.out.println("Subtraction: "+c.sub(10,5));
System.out.println("Multiplication : "+c.mul(5, 19));
System.out.println("Division: "+c.div(10,5));
System.out.println("Exponent: "+c.exp(7,6));
System.out.println("Cube root: "+c.cuberoot (1090));
44
45
46
47
48
49
50
51
52](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Ff1c2b75e-6fee-4f9b-af7a-a18971ffe565%2F319f1fc2-75da-4b0c-b3ae-c4d118511703%2Fnqg38h7_processed.png&w=3840&q=75)
Transcribed Image Text:Main.java x
import java. lang.*;
public class Main{ I
2
//Add various methods to perform different arithme tic operations
public int add(int a, int b){
return a * b;
7
public int sub(int a, int b) {
return a - b;
10
11
public int mul(int a, int b) {
return a * b;
12
13
}
public int div(int a, int b){
if(b == 0){
System.out.println("Dividing value can not be zero! ") ;
14
15
16
17
return 0;
18
19
else{
20
return a/ b;
21
22
}
23
24
public int exp(int base, int expo)
{
25
26
int pow = 1;
//increase the value of i for each iteration
27
for (int i = 1; i <= expo; i++)
//power calculation
28
29
30
pow = pow * base;
//returns power
31
32
return po;
}
33
34
public double cuberoot (int a) {
return Math.cbrt(a);
35
36
37
38
39
// Declare main class to create object of the class and call its methods
40
public static oid main(String[] args){
//Create object or the Cal class
Main c = new Main();
41
42
43
// Call one by one methods of the class and print the results
System.out.println("Addition: "+c.add(5,10));
System.out.println("Subtraction: "+c.sub(10,5));
System.out.println("Multiplication : "+c.mul(5, 19));
System.out.println("Division: "+c.div(10,5));
System.out.println("Exponent: "+c.exp(7,6));
System.out.println("Cube root: "+c.cuberoot (1090));
44
45
46
47
48
49
50
51
52
Expert Solution
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps with 1 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Recommended textbooks for you
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
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)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
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)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
![C How to Program (8th Edition)](https://www.bartleby.com/isbn_cover_images/9780133976892/9780133976892_smallCoverImage.gif)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
![Database Systems: Design, Implementation, & Manag…](https://www.bartleby.com/isbn_cover_images/9781337627900/9781337627900_smallCoverImage.gif)
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
![Programmable Logic Controllers](https://www.bartleby.com/isbn_cover_images/9780073373843/9780073373843_smallCoverImage.gif)
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education