Ask a question from expert

Ask now

Average Numbers Importance of Five Numbers

15 Pages4930 Words206 Views
   

Added on  2020-07-22

About This Document

Programming Task 1 Write a Java method to compute the average of five numbers import java.util.Scanner; public class Avg5 public static void main(String[] args) Scanner in = new Scanner(System.in); System.out.print("Input first number: "); int num1 = in.nextInt(); System.out.print("Input second number: "); int num2 = in.nextIn

Average Numbers Importance of Five Numbers

   Added on 2020-07-22

BookmarkShareRelated Documents
ProgrammingTask 1 a)Write a Java method to compute the average of five numbers import java.util.Scanner;public class Avg5 { public static void main(String[] args) { Scanner in = new Scanner(System.in); System.out.print("Input first number: "); int num1 = in.nextInt(); System.out.print("Input second number: "); int num2 = in.nextInt(); System.out.print("Input third number: "); int num3 = in.nextInt(); System.out.print("Input fourth number: "); int num4 = in.nextInt(); System.out.print("Enter fifth number: "); int num5 = in.nextInt(); System.out.println("Average of five numbers is: " + (num1 + num2 + num3 + num4 + num5) / 5); }}
Average Numbers Importance of Five Numbers_1
b) Write a Java method to count all words in a string. import java.util.Scanner;public class wordcount { public static void main(String[] args) { Scanner in = new Scanner(System.in); System.out.print("Input the string: "); String str = in.nextLine(); System.out.print("Number of words in the string: " +count_Words(str)+"\n"); } public static int count_Words(String str) { int count = 0; if (!(" ".equals(str.substring(0, 1))) || !("".equals(str.substring(str.length() - 1)))) { for (int i = 0; i < str.length(); i++) { if (str.charAt(i) == ' ') { count++; } } count = count + 1; } return count; // returns 0 if string starts or endswith space " ". } }
Average Numbers Importance of Five Numbers_2
Task 2Class DiagramEmployee Table related to depart table.Department table related to Company table.Project table is related to company tables.
Average Numbers Importance of Five Numbers_3
Task 3 a)In a maximum of 500 words, critically evaluate the principles of object oriented programming.Today, object oriented programming will probably be the predominant programming paradigm as wellas Java is completely subject targeted. In addition, Java has become the various used language amongstTHAT service providers. Therefore, scholars often learn Java and subject oriented programming (OOP)actually introductory courses. This permits a perfect basis for a “later introduction to other paradigmswhich includes logical or useful coding. Moreover, OOP helps introducing students to ideas very muchlike specification construction, resistant and also.These techniques start by showing items, interfaces, classes and also features from the beginning, e. l.the Outside-In teaching way of OOP based on the programming vocab Eiffel. Problem Statement:Irrespective of several lecturers having simply by present used the Outside-In teaching approach in theirlessons, little research evidence upon its outcomes dominates. A lot of authors looked simply by thescheduled program action connected with involved students, nevertheless influence on learning effectsas well as enthusiasm and fascination has not been recently researched to date. Research Objective:Educating OO rules to apprentices is usually a great important task of program engineering education.Consequently , with this paper the feasibility as well as effects of employing Outside-In educating forcoaching OOP in a matter of university-level initial courses making use of Java will be empirically lookedat. In particular, the aim was to realize its influence on learning positive components in addition, oninterest and ideas in the participants. Context: We all considered Outside-In teaching in suite an suite intwo opening classes for computer scientific exploration and OOP (Bachelor level, 1st year) at a set ofGerman universities in the winter period 2012/13. The courses have already been Programming andSoftware Development (PSD) at the University associated with Stuttgart (Stuttgart) and DevelopmentTechnique from the study course “Information Management Automotive” (IMA) at the Institution ofModern developments Neu-Ulm (Ulm).The major challenge was the replacement of Eiffel just by Java. Eiffel is more patristic in its object-oriented constructs compared to Java. For example, for Caffeine an early introduction of long termmethods is necessary because the strategy is executed with the everlasting key method. The basicprinciple of carrying out a program in Eiffel will probably be considerably easier. Compared to Eiffel, Javalacks an area support for contracts, added tools have to be applied as a result. Regarding the scope, thetwo classes at Ulm and Stuttgart distinctly are different. Programming as well as Computer programsDevelopment (PSD) with Stuttgart consists of four several hours lecture and two occasions tutorials withteaching colleagues per week. Programming Strategy inside Ulm consists of two a large number of hourslecture and two period lecturer-guided tutorials. Furthermore, only two additional several hours ofencouraged tutorial each week are offered. Several topics just like the setup as well as the functionalrule of a personal computer system or perhaps data structures are generally products of separateaddress classes at Ulm. That is why, these types of units are not included right here. Thus, compared toUlm, for Stuttgart much more issues will be examined during a session. PSD at Stuttgart resembles agreat introduction to computer engineering.
Average Numbers Importance of Five Numbers_4

End of preview

Want to access all the pages? Upload your documents or become a member.

Related Documents
Programming Assignment: Java Programming
|12
|2732
|107

Online Sales and Inventory Management System (SIMS)
|18
|4838
|56

Java Programming Assignments with Solutions
|9
|904
|164

Fundamentals of Operating Systems and Java Programming
|14
|763
|260

Create Files Based on State in Java Programming
|3
|561
|65

Java Assignment Codes
|52
|5341
|240