Skip to content

myuniversitysubmission/Java_self_Assessment-1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

Compact Programming – Java Assignment

This repository contains solutions for the Compact Programming assignment as part of the FH Dortmund online course on Java programming.
The assignment is divided into four tasks, each focusing on a different aspect of Java basics, object handling, and algorithms.

Each task was implemented individually by group members, and the final solutions are documented here.


📌 Problem Statements & Contributions

Task 1 – Language Basics (Math & Variables)

Problem:
Readings: Language Basics: Variables, Operators, Expressions, Statements, and Blocks The diameter of the Sun is approximately 865,000 miles. The diameter of the Earth is approximately 7600 miles. Use the methods in the class Math to calculate, (a) the volume of the Earth in cubic miles (b) the volume of the Sun in cubic miles (c) the ratio of the volume of the Sun to the volume of the Earth and then output the three values. Treat both the earth and sun as spheres. The volume of a sphere is given by the formula 4 pi r^3/3 where r is the radius.

Implemented by: Dnyaneshwar


Task 2 – Language Basics (Control Flow & Primes)

Problem:
Readings: Language Basics : Control Flow Statements

Rewrite a program that prints prime numbers up to a given limit with the following requirements:

  • Use a labeled continue instead of break.
  • Do not use a Boolean isPrime variable.
  • Only check divisors up to the square root of the number.

Implemented by: Adesh


Task 3 – Object Basics (Strings & Characters)

Problem:
Readings: Object Basics and Simple Data Objects, The Life Cycle of an Object,Characters and Strings In the following code the soliloquy is analyzed character by character to determine the vowels, spaces and letters used. Fill in the code that computes the number of spaces, vowels, and consonants.

Implemented by: Anil


Task 4 – Object Basics (Arrays & Sorting)

Problem:
Readings: Object Basics and Simple Data Objects Numbers Arrays Write a program that sets up a String variable with the soliloquy in the previous question, extracts the words from the text and sorts them into alphabetical order. You may define 'words' however you wish (within reason), but provide your definition with your solution. You can use the sorting method of your choice. The simplest one is the bubble sort, which works as follows: • Starting with the first element in the array compare successive elements (0 and 1, 1 and 2, 2 and 3, and so on). • If the first element of any pair is greater than the second, interchange the two elements. • Repeat the process for the whole array until no interchanges are necessary. The array elements will now be in ascending order. • Run the program once you have written your code. Turn in your code, and the output produced when the code runs

Implemented by: Harsha


🎥 Submission Info

  1. All Problem statement solutions: Java Assignments 1.docx
  2. Drive Link (video explanation of the solution): https://drive.google.com/drive/folders/1INbEoNOIywkATXxNOaSSbIDADDMPRnFk

About

Java Programming Tasks

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages