Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Java-Assignment-004.iml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="jdk" jdkName="openjdk-20" jdkType="JavaSDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
40 changes: 40 additions & 0 deletions src/Multadd.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@

public class Multadd {

public static void multadd(double a, double b, double c) {
double result = a*b + c;
System.out.println (result);
}

public static void main(String[] args) {

System.out.print ("The result of 1.0, 2.0, and 3.0 is: ");
multadd(1.0, 2.0, 3.0);
System.out.println();

double a1 = Math.cos(Math.PI/4.0);
double b1 = 1.0/2.0;
double c1 = Math.sin(Math.PI/4.0);
System.out.print ("sin(pi/4) + cos(pi/4)/2 = ");
multadd (a1, b1, c1);
System.out.println();

double a2 = 1.0;
double b2 = Math.log(10);
double c2 = Math.log(20);
System.out.print("log(10) + log(20) = ");
multadd(a2, b2, c2);
System.out.println();
}

public static void expSum(double x) {

//
double a = x;
double b = Math.exp(-x);
double c = Math.sqrt(1.0 - b);
multadd(a, b, c);
System.out.print("xe^(-x) + sqrt (1 - e^(-x) = ");
System.out.println();
}
}