Skip to content

Commit

Permalink
Section 8 Added
Browse files Browse the repository at this point in the history
  • Loading branch information
Mohaned Yossry Abdulaziz committed Dec 31, 2020
1 parent 0187bee commit b43dce9
Show file tree
Hide file tree
Showing 7 changed files with 169 additions and 5 deletions.
19 changes: 14 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,18 +134,27 @@ This repository will contain all materials used throughout the OS course 20/21

````
Introduction to Java Programming and data Structures - Eleventh Edition
***********************************************************************
9.8 Visibility Modifiers => 366
9.9 Data Field Encapsulation => 368
9.13 The Scope of Variables => 379
9.14 The this Reference => 380
=======================================================================
9.8 Visibility Modifiers 👉🏽 366
9.9 Data Field Encapsulation 👉🏽 368
9.13 The Scope of Variables 👉🏽 379
9.14 The this Reference 👉🏽 380
````

### 📖 Section 7 - Chapter 3 - Process and more.
-------
[🎞 Section Presentation](https://drive.google.com/file/d/1HDRkejKpnmqy-8iRcicIaFBJpBBukzRx/view?usp=sharing)

### 📖 Section 8 - ArrayList and Data Transmission through Sockets.
-------
[🎞 Section Presentation](https://drive.google.com/file/d/1Wb6sgHlml35-XUk7iyv7K_n3ZRRkg685/view?usp=sharing)
[‍💻 Section Project](https://minhaskamal.github.io/DownGit/#/home?url=https://github.com/Mohanedy98/OperatingSystemsCourse20-21/tree/main/Section6-BMIProject)

````
Introduction to Java Programming and data Structures - Eleventh Edition
=======================================================================
Networking 👉 Chapter 33
````


## 🍕 Additional Links
Expand Down
71 changes: 71 additions & 0 deletions Section8-Project/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf

# Generated files
.idea/**/contentModel.xml

# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml

# Gradle
.idea/**/gradle.xml
.idea/**/libraries

# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
# .idea/artifacts
# .idea/compiler.xml
# .idea/jarRepositories.xml
# .idea/modules.xml
# .idea/*.iml
# .idea/modules
# *.iml
# *.ipr

# CMake
cmake-build-*/

# Mongo Explorer plugin
.idea/**/mongoSettings.xml

# File-based project format
*.iws

# IntelliJ
out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Cursive Clojure plugin
.idea/replstate.xml

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

# Editor-based Rest Client
.idea/httpRequests

# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser
8 changes: 8 additions & 0 deletions Section8-Project/.idea/.gitignore

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

6 changes: 6 additions & 0 deletions Section8-Project/.idea/misc.xml

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

8 changes: 8 additions & 0 deletions Section8-Project/.idea/modules.xml

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

11 changes: 11 additions & 0 deletions Section8-Project/Section8G1.iml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
51 changes: 51 additions & 0 deletions Section8-Project/src/Section8.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import java.util.ArrayList;

public class Section8 {
public static void main(String[] args) {
ArrayList<Medicine> myList = new ArrayList<>();
Medicine myMedicine = new Medicine("Panadol",20);
myList.add(myMedicine);
Medicine myMedicine2 = new Medicine("Congestal",15);
myList.add(myMedicine2);
for(int i = 0; i < myList.size(); i++){
System.out.println(myList.get(i).getName()+" - "+myList.get(i).getPrice());
}

}
}

class Medicine{
private String name;
private double price;

public Medicine(String name, double price){
setName(name);
setPrice(price);

}

public String getName(){
return name;
}

public void setName(String newName){
if(!newName.isEmpty()){
name = newName;
}else {
System.out.println("Wrong name");
}
}

public double getPrice(){
return price;
}

public void setPrice(double price){
if(price >0){
this.price = price;
}else {
System.out.println("Wrong price");
}
}

}

0 comments on commit b43dce9

Please sign in to comment.