Docsity
Docsity

Prepara tus exámenes
Prepara tus exámenes

Prepara tus exámenes y mejora tus resultados gracias a la gran cantidad de recursos disponibles en Docsity


Consigue puntos base para descargar
Consigue puntos base para descargar

Gana puntos ayudando a otros estudiantes o consíguelos activando un Plan Premium


Orientación Universidad
Orientación Universidad

CSCI251 Advanced Programming Assignment 1 Autumn 2022, Ejercicios de Programación C

This assignment is to be implemented using procedural programming. These are some general rules about what you should and shouldn’t do. 1. Your assignment should be organised into ONLY three source-code files:

Tipo: Ejercicios

2018/2019

Subido el 06/07/2022

pruebas-celulares
pruebas-celulares 🇲🇽

1 documento

1 / 3

Toggle sidebar

Esta página no es visible en la vista previa

¡No te pierdas las partes importantes!

bg1
School of Computing Information Technology
CSCI251 Advanced Programming
Assignment 1 Autumn 2022
Overview
This assignment is to be implemented using procedural programming. These are some general rules about
what you should and shouldn’t do.
1. Your assignment should be organised into ONLY three source-code files:
(a) A driver file containing your main() function. Meanwhile, the main() function should make it
clear what is going on, and shouldn’t be too large.
(b) A header file containing the prototypes for the functions you write.
(c) An implementation file containing the implementations of your functions.
2. Provide a text file Readme.txt with instructions for compiling details, such as codeblocks or Capa.
3. Within your code, be consistent in your tabbing style. We want readable code.
4. Include sensible volumes of commenting.
5. Use appropriate variable names.
6. Don’t leak memory.
7. Our marking system will run on Capa and Codeblocks. Make sure that your code can run on either
system.
Description
This program is used to simulate the process of the mechanical repairs, and we simplify some steps here.
The “claims.txt” and “mechanics.txt” file saves the information from individual claim and mechanic,
respectively.
Each claim (one line record from the “claims.txt”) represents a (car) repairing requirement, while it
attempts to go through mechanics ONLY in its own list. They will try from the first to the last one (one
mechanic for one time) to see if this mechanic could fix the problem (as the trial process). The process
stops if one trial gets successful, otherwise it will go to the next mechanic (for another trial). This claim
fails if no trials (mechanics) are successful in the list, and it will consider as the (car) scrap.
1
pf3

Vista previa parcial del texto

¡Descarga CSCI251 Advanced Programming Assignment 1 Autumn 2022 y más Ejercicios en PDF de Programación C solo en Docsity!

School of Computing Information Technology

CSCI251 Advanced Programming

Assignment 1 Autumn 2022

Overview

This assignment is to be implemented using procedural programming. These are some general rules about what you should and shouldn’t do.

  1. Your assignment should be organised into ONLY three source-code files:

(a) A driver file containing your main() function. Meanwhile, the main() function should make it clear what is going on, and shouldn’t be too large. (b) A header file containing the prototypes for the functions you write. (c) An implementation file containing the implementations of your functions.

  1. Provide a text file Readme.txt with instructions for compiling details, such as codeblocks or Capa.
  2. Within your code, be consistent in your tabbing style. We want readable code.
  3. Include sensible volumes of commenting.
  4. Use appropriate variable names.
  5. Don’t leak memory.
  6. Our marking system will run on Capa and Codeblocks. Make sure that your code can run on either system.

Description

This program is used to simulate the process of the mechanical repairs, and we simplify some steps here. The “claims.txt” and “mechanics.txt” file saves the information from individual claim and mechanic, respectively. Each claim (one line record from the “claims.txt”) represents a (car) repairing requirement, while it attempts to go through mechanics ONLY in its own list. They will try from the first to the last one (one mechanic for one time) to see if this mechanic could fix the problem (as the trial process). The process stops if one trial gets successful, otherwise it will go to the next mechanic (for another trial). This claim fails if no trials (mechanics) are successful in the list, and it will consider as the (car) scrap.

Rules

We are using the below formula to decide the repair probability:

  • the successful probability follows a normal distribution, and its mean and standard deviations is calculated as follows:
  • Mean = mechanic ability - claim complexity
  • Standard deviation = claim uncertainty + mechanic variability

Here goes an example using the data listed in the next section. If the claim (claimId = 123) is taking John (mechanicId = 0), the Mean and Standard deviation should be as follows:

  • Mean = 50 - 10 = 40
  • Standard deviation = 5 + (-2) = 3

Next, to determine the outcome of the claim, we consider the following rules:

  • 0-50: this trial fails; try next one (if available)
  • 50+: successful (repair)

Inputs

Two data files will be provided (you CANNOT change their contents), with the colon and comma used to separate fields.

  1. claims.txt:

claimId,description,complexity,uncertainty,mechanics:a list

Example:

123,flat tire,10,5,mechanics:0,

  1. mechanics.txt:

mechanicId,name,ability,variability

Example:

0,John,50,-