Computer programming

Assignment Help C/C++ Programming
Reference no: EM131211386

Computer Programming

Objectives:

1. Opening a file, reading from file, writing to a file and closing a file.

2. Sequential access files handling.

3. Practice C++ programming problems.

Note: Carefully read the following instructions (Each instruction contains a weightage)

1. There must be a block of comments at start of every question's code by students; the block should contain brief description about functionality of code.

2. Proper indentation of code is essential

3. Write a C++ statement(s) for each of the following task one after the other, in the same order.

4. Make a Microsoft Word file and past all of your C++ code with screenshot of outputs in MS word.

5. First think about statement problems and then write/draw your logic on copy.

6. After copy pencil work, code the problem statement on MS Studio C++ compiler.

7. At the end when you done your today lab tasks , attached all created C++ files+ MS word file and make your submission on slate.

PROBLEM 1.

A class instructor found that the class he is teaching have a habit of not doing assignments by themselves. He looked into all the previous assignment submissions and found a very interesting pattern that, the students take assignment only from their neighbor roll no’s. and submit it as it is but the tricky part is that odd roll no’s only copy it from their odd neighbors and even roll no’s copy it only from their even neighbors. E.g. if a student has roll no. 23, the possibility is that he/she can copy the assignment from roll no 21 or 25 as they are the odd  neighbor  of roll no 23. Similarly even neighbors of roll no. 2 are 0 and 4.

The instructor evaluates the assignments and assigns marks as floating point values. The instructor knows that if 2 students have submitted the same assignment they will get same marks. So the instructor quickly wants to find out how many students are involved in copy-case and what are their roll no’s. Unfortunately the instructor doesn’t know the programming and needs your help. The instructor will provide you the data in below format.

First line of input contains an integer N where N should be greater than 0 and less than 100, denoting the number of students. Then following N space separated floating point values in next line representing each student’s marks in assignment. You can assume that the student roll no’s start from 0 and the student’s assignment marks is input and it is sorted roll no wise. So first entry of marks is off roll no. 0 and the last entry will have roll # (N-1).

You are to read assignment marks of all the students and store them in an array and the indexes of the array would represent roll no’s.

Now your task is to find out how many students are involved in copy case and what are their roll no’s. Your program should find this based on the criteria of odd and even neighbors that instructor mentioned above. The example below will give you the complete idea.

Example:

Input:

8

3.5  9.4  13.42  9.4  45.56  45.56  45.56  3.5 

Array mapping:

Your array should look like this:

Array Index (Roll NO’s)

0

1

2

3

4

5

6

7

Assignment Marks

3.5

9.4

13.42

9.4

45.56

45.56

45.56

3.5

 Output:

Count of students involved in copy case: 4

Roll no’s of students involved: 1, 3, 4, and 6

PROBLEM 2.

Write a C++ program to sort an array of 10 elements by bubble sort algorithm. First you have to initialize array with random numbers less than 15 then you will sort it in ascending order.

Verified Expert

#include<iostream> using namespace std; int main() {int temp; int arr[10]; cout<<"Enter numbers in array:"<<endl; for(int i=0;i<10;i++)

Reference no: EM131211386

Questions Cloud

Linear beam element in abaqus : ENCOR4050 Modelling and Simulation in Engineering Project - Compare the quality of 3-node triangular, 6-node triangular, 4-node quadrilateral and 8-node quadrilateral elements - Linear beam element in Abaqus
Assignment for behs parenting today : You are a famous child development expert with specialties in the topics we've just covered in Weeks #1-4. You have been contacted by Parenting Magazine to write a research-based article on one of the following controversial parenting practices:
Explain how cell elongation occurs : Draw arrows from longitudinal figure to cross section matching each tissue to correct primary meristem.
Is there an element of surprise or the unexpected : Is there an element of surprise or the unexpected? What technique was used? Is the process apparent? Can you associate it with an artistic style or idea (classical nonrepresentational, abstract, surrealistic, etc.)?
Computer programming : Opening a file, reading from file, writing to a file and closing a file. Sequential access files handling. Practice C++ programming problems.
How might the precautionary principle apply to this study : What other recent studies can you find that either contradict or support these findings? Do the other studies impact your assessment of the significance and interpretation of this study? How? Be sure to provide the full citation for the other stud..
Would you like to sell any of the properties : Would you like to sell any of the properties? If so which one and why? Currently the appraisal on the condo is $135,000 and the house is $70,800. What about raising the rent on the properties?
Design and develop a web site for the bsit program : Purpose: To design and develop a web site for the BSIT program offered by the MSIS Department of College of Management, UMass Boston to promote this program to potential students
Did the author forget to include other information : Were there information in the article that you did not know prior to the article? What were those information? What else was missing from the paper? Did the author forget to include other information?

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Add a copy constructor

Take the code below and add a copy constructor, assignment operator definition and destructor to the class. These functions have already been started for you.

  Use the top-down modular approach to design program

Use the top-down modular approach and pseudocode to design a suitable program to solve it. Where appropriate, use defensive programming techniques.

  Lab9 c lab 9 c i request this twice but no answer on this

lab 9 c ltbrgti request this twice but no answer on this please could you check this for

  Csc302 make any dfa in jflap software and run for several

make any dfa in jflap software and run for several inputs. take a screen shot and include in your assignment. keep in

  Write a program that will insert random integers

The value will be the random number. Use an iterator to print the two fields lined up on the right with field widths in two columns with the numbers labeled with centered column headings of Key and Value. Since the list is easier to work with, let..

  Study on sparse matrix collapse

Discuss in what ways such a structure is similar to and/or different than a list.

  Create an order application

Create an Order application that prompts the employee for the number of burgers, fries, and sodas and then display the total, the tax (6.5%), and the final cost.

  The missing line of implementation file

Which of the following could be used as the missing line of this implementation file to overload the assignment (=) operator for the MyBag class?

  Write a program that reads two separate integers from user

Write a single-file program (named main.cpp) that reads two separate integers from the user, adds them together, and then outputs the answer.

  Implement recursive algorithms using a stack

Show the difficulties of the added complexity and which of the two sorts is easier to implement nonrecursively? Why?

  Write a program that will represent an axis-aligned

Write a program that will represent an axis-aligned right triangle in the x-y plane as a Class. A right triangle has a right angle (90-degree angle) and two sides adjacent to the right angle, called legs. See http://en.wikipedia.org/wiki/Right_tri..

  Create your own unique while-end repetition code

Create your own unique While-End or (For End) repetition C code. You decide the theme. Be sure to provide an overview of what your repetition structure is doing.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd