Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class kompotInfo {
- String kompotFruit;
- String kompotColour;
- double kompotVolume;
- double kompotContent;
- void kompotInfo() {
- System.out.printf("The kompot is made from: %s \n ", kompotFruit);
- System.out.printf("The kompot's colour is %s \n", kompotColour);
- System.out.printf("The kompot's volume is %.2f \n", kompotVolume);
- System.out.printf("The kompot's content is %.2f \n", kompotContent);
- }
- void addToContent(double ml) throws Exception {
- if((this.kompotContent+ml)>this.kompotVolume) {
- throw new Exception();
- }
- else {
- }
- this.kompotContent+=ml;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement