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

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

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