Ask Homework Help/Study Tips Expert

Section-A

Task 1: Initializing array.

1. Reversing an array:
classArrayReverseExample
{ static void Main()
{ int[] array = { 1, 2, 3, 4, 5 };
// Get array size intlength = array.Length;
// Declare and create the reversed array int[] reversed = new int[length];

// Initialize the reversed array
for(intindex = 0; index < length; index++)
{ reversed[length - index - 1] = array[index]; }

// Print the reversed array
for(intindex = 0; index < length; index++)
{
Console.Write(reversed[index] + " "); }
}
}

2. Here is the result of the above example's execution for n=7: 5 4 3 2 1

Task 2: Reading an Array from the Console

1. Declaring array dynamically and assigning values at run time to it intn = int.Parse(Console.ReadLine()); int[] array = new int[n];

for(inti = 0; i< n; i++)
{ array[i] = int.Parse(Console.ReadLine());
}

Task 3: Printing an Array to the console

1. Displaying array values
string[] array = { "one", "two", "three", "four" };
Console.WriteLine(array);
string[] array1 = { "one", "two", "three", "four" }; for (intindex = 0; index {
// Print each element on a separate line
Console.WriteLine("Element[{0}] = {1}", index, array[index]); }

2. We are iterating through the array using the for-loop, which will go array.Length times, and we will print the current element using Console.WriteLine() and a formatted string. Here is the result:
Element[0] = one
Element[1] = two
Element[2] = three
Element[3] = four

Task 4: Symmetric Array

1.To check whether the array values inserted are symmetric or not. Few examples of symmetric arrays are given below:
Console.Write("Enter a positive integer: "); intn = int.Parse(Console.ReadLine()); int[] array = new int[n];

Console.WriteLine("Enter the values of the array:"); for (inti = 0; i< n; i++)
{ array[i] = int.Parse(Console.ReadLine());
}
boolsymmetric = true;

for(inti = 0; i{ if(array[i] != array[n - i - 1])
{ symmetric = false; break;
}
}

Console.WriteLine("Is symmetric? {0}", symmetric);

Task 5: Two-dimensional array
1.Reading Matrices from the Console:
Console.Write("Enter the number of the rows: "); introws = int.Parse(Console.ReadLine());

Console.Write("Enter the number of the columns: "); intcols = int.Parse(Console.ReadLine());

int[,] matrix = new int[rows, cols];

Console.WriteLine("Enter the cells of the matrix:"); for (introw = 0; row < rows; row++)
{ for(intcol = 0; col < cols; col++)
{
Console.Write("matrix[{0},{1}] = ",row, col); matrix[row, col] = int.Parse(Console.ReadLine()); }
}
for(introw = 0; row { for(intcol = 0; col {
Console.Write(" " + matrix[row, col]); }
Console.WriteLine();
}
2.The program output when we execute it is
Enter the number of the rows: 3
Enter the number of the columns: 2
Enter the cells of the matrix: matrix[0,0] = 2 matrix[0,1] = 3
matrix[1,0] = 5 matrix[1,1] = 10 matrix[2,0] = 8 matrix[2,1] = 9
2 3
5 10
8 9
Task 6: jagged array
1.Develop a program to generate and visualize the Pascal's triangle:
1
1 1
1 2 1
1 3 3 1
1 4 6 4 1 . . .
classPascalTriangle
{ static void Main()
{ constintHEIGHT = 12;

// Allocate the array in a triangle form long[][] triangle = new long[HEIGHT + 1][];

for(introw = 0; row < HEIGHT; row++)
{
triangle[row] = new long[row + 1];
}

// Calculate the Pascal's triangle triangle[0][0] = 1;
for(introw = 0; row < HEIGHT - 1; row++)
{ for(intcol = 0; col <= row; col++)
{ triangle[row + 1][col] += triangle[row][col]; triangle[row + 1][col + 1] += triangle[row][col];
}
}

// Print the Pascal's triangle for(introw = 0; row < HEIGHT; row++) {
Console.Write("".PadLeft((HEIGHT - row) * 2)); for (intcol = 0; col <= row; col++)
{
Console.Write("{0,3} ", triangle[row][col]);
}
Console.WriteLine();
}
}
}
2.The program output when we execute it is
1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
1 5 10 10 5 1
1 6 15 20 15 6 1
1 7 21 35 35 21 7 1
1 8 28 56 70 56 28 8 1
......
1 11 55 165 330 462 462 330 165 55 11 1
Exercise
7.1 Develop a program which will initialize array dynamically, take input values for array, and display the values of array on the console.
7.2 Develop a program which will find the sub-matrix of size of 2 by 2 with maximum sum of its elements from a two-dimensional rectangular (example: 4 rows and 6 columns) array (matrix) of integers, and print it to the console.

Section-B

Task 1: Substring.

1.Write a program to List all Substrings in a given String.
using System;
namespace mismatch
{
class Program
{
string value, substring;
int j, i;
string[] a = new string[5];

void input()
{
Console.WriteLine("Enter the String : "); value = Console.ReadLine();
Console.WriteLine("All Possible Substrings of the Given String are :");

for (i = 1; i <=value.Length; i++)
{
for (j = 0; j <= value.Length - i; j++)
{

substring = value.Substring(j, i); a[j] = substring; Console.WriteLine(a[j]);
}
}
}

public static void Main()
{
Program pg = new Program();
pg.input(); Console.ReadLine();
} }
}

2.Here is the output of the C# Program.
Enter the String : abab
All Possible Substrings of the Given String are :
a b a b ab ba ab aba bab abab

Task 2: Reversing String
1.C# Program to Reverse a String without using Reverse function
using System;

class Program
{
static void Main(string[] args)
{
string Str, reversestring = ""; int Length;

Console.Write("Enter A String : ");
Str = Console.ReadLine();

Length = Str.Length - 1;

while (Length >= 0)
{
reversestring = reversestring + Str[Length];
Length--;
}

Console.WriteLine("Reverse String Is {0}", reversestring); Console.ReadLine();
}
}

2.Here is the output of the C# Program.
Enter a String : Melbourne Reverse String is : enruobleM

Task 3: Replace String
1.Write a Program to Replace String in String
using System;
class Program
{
static void Main()
{
const string s = "Sun Rises in the West";
Console.WriteLine("Sentence Before Replacing : {0} ",s);

string s1 = s.Replace("West", "East");
Console.WriteLine("Sentence After Replacing : {0} ",s1);

Console.ReadLine();
}
}

2.Here is the output of the C# Program.
Sentence Before Replacing : Sun Rises in the West
Sentence After Replacing : Sun Rises in the East
Exercises
8.1 Write a C# program to Trim the Given String.
8.2 Write a C# program to Convert Upper case to Lower Case.

Section -C

Task 1: Function with parameters.
1. Write a function FindMax that takes two integer values and returns the larger of the two. It has public access specifier, so it can be accessed from outside the class using an instance of the class.

2. Add following code segment in the Main function. int a = 100; int b = 200;
int ret;
//calling the FindMax method
ret = FindMax(a, b);
Console.WriteLine("Max value is : {0}", ret );

3. Here is the result of the above example's execution: Max value is : 200

Task 2: Calling function with arguments of pass by reference.
1. Write a function swapnum that takes two integer values and interchange the value of variables. It has public access specifier, so it can be accessed from outside the class using an instance of the class.

public static void swapnum(ref int x, ref int y)
{
int temp;

temp = x; /* save the value of x */

x = y; /* put the value of y into x */

y = temp; /* put value of temp into y */
}
2. Now call the swapnum function within the Main function

int a = 100; int b = 200;

Console.WriteLine("Before swap, value of a : {0}", a);
Console.WriteLine("Before swap, value of b : {0}", b);

/* calling a function to swap the values */ swapnum(ref a, ref b);

Console.WriteLine("After swap, value of a : {0}", a);
Console.WriteLine("After swap, value of b : {0}", b);

3. Here is the result of the above example's execution:
Before swap, value of a : 100
Before swap, value of b : 200
After swap, value of a : 200
After swap, value of b : 100

Task 3: Write two functions to achieve two functionalities separately.
1.Write a program two achieve functionality of addition and subtraction respectively.

public int subtract(int firstNumber, int secondNumber)
{
int answer;
answer = firstNumber - secondNumber;
return answer;
}

public int addUp(int firstNumber, int secondNumber)
{
int answer;
answer = firstNumber + secondNumber;
return answer;
}

2. Create new class with name Program. Call both functions from Main function. Use following code. int number1 = 20; int number2 = 7; int subAnswer;
int addAnswer;

// creating an object of calculator class
Program cal = new Program(); subAnswer = cal.subtract(number1, number2); addAnswer = cal.addUp(number1, number2);

Console.WriteLine("Addition answer is {0}", subAnswer);
Console.WriteLine("Subtraction answer is {0}", addAnswer);

Console.Read();

3. Here is the result of the above example's execution:
Addition answer is 27
Subtraction answer is 13

Task 4: Recursive function.
1.Write a program which reads an integer from the console, computes its factorial and then prints the obtained value.
static decimal Factorial(int n)
{
// The bottom of the recursion if (n == 0)
{ return 1;
}
// Recursive call: the method calls itself else
{ return n * Factorial(n - 1);
}
}
2. Call Method Factorial in the Main Method as below.
static void Main()
{
Console.Write("n = ");
int n = int.Parse(Console.ReadLine()); decimal factorial = Factorial(n);
Console.WriteLine("{0}! = {1}", n, factorial);
}
3. Here is the result of the above example's execution for n = 5:
5! = 120
Exercises
9.1 Write a C# program with following method.
Method Name - CalcDiscount
Return type - float
Parameters - The amount and the percentage in float
Task of the method - Calculate the value for the given amount using given percentage and return the discount value. (e.g., amount = amount *percentage/100)
9.2 Add two more Methods to your code in task 3, like Multiply and Divide.

Section -D

Objective(s)
This assessment item relates to the unit learning outcomes as in the unit descriptors. This checks your understanding about basic constructs of C# programming.

Details & Problems
In this assignment, you are required to answer the short questions, identify error in the code, give output of the code and develop three C# Console Programs to demonstrate your ability to use C# input/output via command line, C# primitive and built-in C# types, C# operators and expression, C# conditional statements, C# loop construct, and show your ability to validate the inputs to avoid run-time errors.

Q1) What is managed and unmanaged code?
Q2) Give examples of reserved keyword, literals and data types in C#.
Q3) What is the difference between "continue" and "break" statements in C#? Explain it with example.

Q4) What will be the output / error of given program?
static void Main(String[] args)
{
constint m = 100; int n = 10;
constint k = n / 5 * 100 * n;
Console.WriteLine(m * k);
Console.ReadLine();
}
Q5) Give the output for the set of programming code. class Program
{
static void Main(string[] args)
{
inti;
for ( i = 0; i< 5; i++)
Copyright  2015-2018 VIT, All Rights Reserved. 2

{
}
Console. WriteLine(i);
Console. ReadLine();
}
}
Q6) Write a program that would convert temperature given in Centigrade scale to Fahrenheit - the number can be integer or real. Use the formula: F = 1.8C + 32
Q7)Given a three-digit integer as input write a C# program to determine whether the number is an Armstrong number. An Armstrong number is one for which the sum of each digit raised to the power of number of digits results in the number itself.
For a three digit number 153 = 13 + 53 + 33
Note: Confine to 3-digit examples only i.e., number values between 100 to 999.
Q8) Use Euclid's Algorithm given below to determine the LCM and HCF for given two integer numbers.
- Take in as input two numbers A and B.
- Subtract the smaller of the two numbers from the Larger Number and assign the answer to the larger number.
- The above process is repeated until both the numbers are equal, say X.
- Apparently, the residual number (X) that we have obtained is the HCF.
- LCM could then be computed using the formula (A*B)/HCF Print out your answers.

Section-E

Task 5.1: Review Questions

1. What is the main function of the Data Flow Diagrams?

2. What items depict in a Data Flow Diagrams?

3. What are the advantages of Data Flow Approach?

4. Draw the basic Symbols and name them.

5. What is an externa entity in a Data Flow Diagram?

6. What is a Data Flow in a Data Flow Diagram?

7. What is a process in a Data Flow Diagram?

8. What is a data store in a Data Flow Diagram (DFD)?

9. What are the steps of developing a Data Flow Diagram?

10. What is a context diagram and what are the items ?

11. What are the basic rules of a DFD?

12. What are Data Flow Diagrams Levels ?

13. What are the possible errors that could happen when you draw DFDs?

14. What are the differences between Logical Vs Physical Data Flow Diagrams?

15. What are the common features for logical and physical Data Flow Diagrams?

16. What is a CURD matrix ?

17. Explain how events can be modeled by the DFDs?

18. What are the difference with Use Cases and the Data Flow Diagrams?

19. What are the reasons for partitioning Data Flow Diagram?

What are the advantages for partitioning DFD for a website?

Task 5.2: Problems

1. Refer the Data Flow Diagram - Context diagram given below. Identify followings.
a. External entities,
b. Data flows
c. The main process
d. List three child process for this context diagram.

Section-F

Task 6.1: Review Questions

1. What is a data dictionary?

2. What is XML schema?

3. What is a data repository?

4. How data dictionaries relate to the Data Flow Diagrams (DFD) ?

5. What are the data dictionary categories?

6. What are the elements of a data flow? Name and give examples for each element.

7. Explain the algebraic notations using in the data dictionary ?

8. What is a structural record? Give example for a structural record.

9. What is a logical and physical data structure?

10. What do you mean by element is base or derived ?

11. Name data formats used in PC.

12. How format character codes are used in forms ? Explain with an examples.

13. What is a validation criteria?

14. What is a default value?

15. What are data stores?

16. How helpful data dictionaries to create XML documents and schemas?

17. What is an entity?

18. What is a weak entity?

19. What is an Attribute?

20. Name and give examples for different types of attributes.

21. What is a relationship?

22. What is a degree of a relationship? give examples.

23. What is the cardinality of a relationship? Explain each with examples.

24. What is crow's foot notation? How each cardinality is represented in crow's foot relationship ?
Explain with diagrams.

Task 6.2: Problems

1. Notown records has decided to store information on musicians who perform on their albums (as well as other company data) in a database. The company has chosen to hire you as a database designer.

- Each musician that records at Notown has an SSN, a name, an address and a phone number.
- Each instrument that is used in songs recorded at Notown has a name (e.g. guitar, synthesizer, flute) and a musical key (e.g., C, B-flat, Eflat).
- Each album that is recorded at the Notown label has a title, a copyright date, a format (e.g., CD or MC) and an album identifier.
- Each song recorded at Notown has an id, title and an author.
- Each musician may play several instruments, and a given instrument may be played by several musicians.
- Each album has a number of songs on it, but no song may appear on more than one album.
- Each song is performed by one or more musicians, and a musician may perform a number of songs.
- Each album has exactly one musician who acts as its producer. A producer may produce several albums.

2. Draw Entity Relationship Diagram for the airport database
Computer Sciences Department frequent fliers have been complaining to Dane County Airport officials about the poor organization at the airport. As a result, the officials decided that all information related to the airport should be organized using a DBMS, and you have been hired to design the database. Your first task is to organize the information about all the airplanes stationed and maintained at the airport. The relevant information is as follows:
Every airplane has a registration number, and each airplane is of a specific model.

The airport accommodates a number of airplane models, and each model is identified by a model number (e.g., DC-10) and has a capacity and a weight.

A number of technicians work at the airport. You need to store the name, SSN, address, phone number, and salary of each technician.

Each technician is an expert on one or more plane model(s).

Traffic controllers must have an annual medical examination. For each traffic controller, you must store the date of the most recent exam.

All airport employees (including technicians and traffic controllers) belong to a union. You must store the union membership number of each employee. You can assume that each employee is uniquely identified by a social security number.

The airport has a number of tests that are used periodically to ensure that airplanes are still airworthy. Each test has a Federal Aviation Administration (FAA) test number, a name, and a maximum possible score.

The FAA requires the airport to keep track of each time that a given airplane is tested by a given technician using a given test. For each testing event, the information needed is the date, the number of hours the technician spent doing the test, and the score that the air plane received on the test.

Section-G

Task 7.1: Review Questions

1. What is Agile Modeling?

2. What are the values and principles of Agile Modelling?

3. What are the basic principles of Agile Modelling?

4. What are the basic Activities in Agile Modelling? Explain each activity.

5. Four resources control variables of Agile Modelling?

6. Four core agile practices?

7. Explain briefly agile development process?

8. What is a user story ?

9. Give examples for Agile Modelling.

10. What is Scrum? Explain different key terms.

11. What are the lessons learned from agile modelling?

12. Compare Agile with Structured Modelling.

13. What are the risks new information systems will balance?

14. What are the risks of adopting a new information system?

15. List the different ways that you can list the decisions.

16. What is a process specification?

17. List the goals of producing process specifications.

18. Explain how the process specification is relate to the Data Flow Diagram (DFD)?

19. List the items in a Process specification. And briefly explain each item briefly.

20. What are the common business rule formats?

21. How structured English is used to represent the logic of a program?

22. What is a decision tree? And why we should use the decision tree.

Task 7.2: Problems
1. Develop decision table for the question "What coat to be worn?"

2. Consider the scenario "Permit login to the system when username and password is given". Develop a decision table.

3. Consider the following scenario and develop a decision table.

"A supermarket has a loyalty scheme that is offered to all customers. Loyalty card holders enjoy the benefits of either additional discounts on all purchases or the acquisition of loyalty points, which can be converted into vouchers for the supermarket or to equivalent points in schemes run by partners. Customer without a loyalty card receive an additional discount only if they spend more than $100 on any one visit to the store, otherwise only the special offers offered to all customers apply"

Section-H

Task 9.1: Review Questions

1. What is defined by human computer interaction (HCL)?

2. What is a task in HCL?

3. What is a performance?

4. What is usability ?

5. What are the different forms that data are available ?

6. What is a pivot table?

7. What is a dashboard in an information system?

8. What are the physical consideration in HCO Design?

9. What are the interface design objectives?

10. Types of user interfaces?

11. What are the natural language interfaces?

12. List different types of interfaces and explain each.

13. What are the special considerations when you design interfaces to a smartphone?

14. What are the gestures that can be used to interface with touch sensitive smart phones?

15. What are the guidelines for dialog design?

16. List and briefly explain different types of queries?

17. What are the different methods of queries?

Task 9.2: Problems
1.Please explain usability of items in figure 1.

a.A tea cup b.A mobile phone (in 1987)
Figure 1. Two items - tea cup and a mobile phone

2. When you are developing a website, following could be the main considerations.
1. Easy to understand navigation
2. Proper use of color
3. Proper use of animation
4. An easy to use layout
5. Pleasing to the eye
6. Appropriate to the topic
7. The design elements don't get in the way of the content
8. Great content that's easy to find, navigate, consume, and share
Please evaluate the website given in figure 2 against the above considerations.

3. The menu structure for Holiday Travel Vehicle's existing character-based system is shown here. Develop and prototype a new interface design for the system's functions, using a graphical user interface. Assume that the new system will need to include the same functions as those shown in the menus provided. Include any messages that will be produced as a user interacts with your interface (error, confirmation, status, etc.). Also, prepare a written summary that describes how

Section- I

Task 10.1: Review Questions

1. What is object oriented Analysis and Design?

2. What is an Object?

3. What is classes?

4. Draw and show an example of UML class.

5. What is inheritance?

6. With an example show inheritance in a class diagram?

7. What are CRC cards and what is the use of CRC cards?

8. How the interaction will occur during a CRC Session?

9. What is Unified Modeling Language (UML)?

10. What is mean by "Things" in UML ? Explain with examples.

11. What is mean by "Relationships"? Explain with examples.

12. What is mean by Structural relationships? Give examples.

13. What is mean by Behavioral relationships? Give examples.

14. What are the different type of diagrams types?

15. What are structural diagrams?

16. What are the behavioral diagrams?

17. What are the commonly used UML diagrams and explain each briefly.

18. Explain with a diagram the overview of the UML diagrams.

19. What is use case modeling?

20. What is an activity diagram?

21. What is a swimlane in Activity diagram?

22. What is a sequence diagram?

23. What is communication diagram?

24. What is a class diagram? Explain with an example?

25. What is method overloading?

26. What are the different types of classes and explain each.

27. What is a relationship and what are the different types of relationships?

28. What is generalization?

29. What is the inheritance?

30. What is polymorphism?

31. What is a message?

32. What is a statechart diagram?

33. What is a package?

Task 10.2: Problems

1.Create a use case diagram that would illustrate the use cases for the following dentist office system:

Whenever new patients are seen for the first time, they complete a patient information form that asks their name, address, phone number, and brief medical history, which is stored in the patient information file. When a patient call to schedule a new appointment, or change an existing appointment, the receptionist checks the appointment file for an available time. Once a good time is found for the patient, the appointment is scheduled. If the patient is a new patient, an incomplete entry is made in the patient file; the full information will be collected when the patient arrives for the appointment. Because appointments are often made far in advance, the receptionist usually mails a reminder postcard to each patient two weeks before his or her appointment.

Attachment:- Assignment.rar

Homework Help/Study Tips, Others

  • Category:- Homework Help/Study Tips
  • Reference No.:- M93133919
  • Price:- $140

Guranteed 48 Hours Delivery, In Price:- $140

Have any Question?


Related Questions in Homework Help/Study Tips

Review the website airmail service from the smithsonian

Review the website Airmail Service from the Smithsonian National Postal Museum that is dedicated to the history of the U.S. Air Mail Service. Go to the Airmail in America link and explore the additional tabs along the le ...

Read the article frank whittle and the race for the jet

Read the article Frank Whittle and the Race for the Jet from "Historynet" describing the historical influences of Sir Frank Whittle and his early work contributions to jet engine technologies. Prepare a presentation high ...

Overviewnow that we have had an introduction to the context

Overview Now that we have had an introduction to the context of Jesus' life and an overview of the Biblical gospels, we are now ready to take a look at the earliest gospel written about Jesus - the Gospel of Mark. In thi ...

Fitness projectstudents will design and implement a six

Fitness Project Students will design and implement a six week long fitness program for a family member, friend or co-worker. The fitness program will be based on concepts discussed in class. Students will provide justifi ...

Read grand canyon collision - the greatest commercial air

Read Grand Canyon Collision - The greatest commercial air tragedy of its day! from doney, which details the circumstances surrounding one of the most prolific aircraft accidents of all time-the June 1956 mid-air collisio ...

Qestion anti-trustprior to completing the assignment

Question: Anti-Trust Prior to completing the assignment, review Chapter 4 of your course text. You are a manager with 5 years of experience and need to write a report for senior management on how your firm can avoid the ...

Question how has the patient and affordable care act of

Question: How has the Patient and Affordable Care Act of 2010 (the "Health Care Reform Act") reshaped financial arrangements between hospitals, physicians, and other providers with Medicare making a single payment for al ...

Plate tectonicsthe learning objectives for chapter 2 and

Plate Tectonics The Learning Objectives for Chapter 2 and this web quest is to learn about and become familiar with: Plate Boundary Types Plate Boundary Interactions Plate Tectonic Map of the World Past Plate Movement an ...

Question critical case for billing amp codingcomplete the

Question: Critical Case for Billing & Coding Complete the Critical Case for Billing & Coding simulation within the LearnScape platform. You will need to create a single Microsoft Word file and save it to your computer. A ...

Review the cba provided in the resources section between

Review the CBA provided in the resources section between the Trustees of Columbia University and Local 2110 International Union of Technical, Office, and Professional Workers. Describe how this is similar to a "contract" ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As