Giter Club home page Giter Club logo

miniprojecto-introducao-programacao's Introduction

Miniprojecto Introdução a Programação

Miniprojecto da disciplina de Introdução a Programação realizada na linguagem C no meu primeiro ano de curso (2017)

O miniprojecto tem como objetivo aprofundar os seus conhecimentos na linguagem de programação C, colocando em prática os conhecimentos já adquiridos, desde estruturas condicionadas, de repetição e estruturas de múltiplas escolhas, funções e procedimentos, etc. Para tal irá desenvolver um programa em C, baseando em funções, com a seguinte estrutura:

Ao executar o programa deverá ser apresentado o seguinte menu de opções:

1 - Diferença da Soma dos Quadrados

2 - Simplificação das Frações

3 - Operação entre Números Binários

4 - Problema dos Sucessores

5 - Dados Estatísticos

6 - Sopa de letras na formação de palavras

7 - Sair.

O utilizador escolhe entre uma destas opções:

1- O programa deve mostrar a diferença entre a soma dos quadrados dos primeiros N números naturais e o quadrado da soma dos mesmos. Por exemplo: A soma dos quadrados dos dez primeiros números naturais ´e, 12 + 22 + ... + 102 = 385. O quadrado da soma dos dez primeiros números naturais ´e, (1 + 2 + ... + 10) 2 = 552 = 3025. Daí a diferença entre a soma dos quadrados dos dez primeiros números naturais e o quadrado da soma ´e 3025 - 385 = 2640.

2- Considere uma fração no formato N/M sendo N inteiro (0 <= N <= 10000) e M inteiro (1 <= M <= 10000). O programa deve ser capaz de simplificar uma fração neste formato tal que o novo numerador e o novo denominador sejam mínimos. O programa receberá um conjunto de testes composto por um número indefinido de linhas. Cada linha conterá os valores de N e M separados por um espaço. O final da entrada será indicado por N=M=0. A saída do programa deverá ser a fração simplificada na mesma ordem da entrada uma em cada linha separando-se o numerador e o denominador por espaço.

3- Faca um programa capaz de operar dois números de 0-255 informados em binário. A resposta deve ser dada também em binário. Deve-se aceitar os seguintes operadores: +,-,*,/.

4- Faça um programa que solicite números inteiros I (−4000 <= I <= 4000) enquanto I for diferente de zero. Quando I for zero o programa deve imprimir todos os sucessores inteiros imediatos de cada I informado. Observe que neste problema não há um limite para a quantidade de números I informados.

5- Escrever um programa que determine o histograma, media e desvio padrão de um vetor de reais. O histograma representa, num vetor apropriado, o numero de ocorrências dos n elementos do vetor em cada um de k intervalos de largura (max(x) – min(x))/k. O desvio padrão, s, é uma medida de dispersão dos elementos de x em torno da media, m , e é definido como:

image

6- Faça um programa capaz de aceitar uma string S e um grupo de N palavras P. Para cada palavra digitada deve-se verificar a possibilidade de formá-la com as letras da string informada. Considere que: Todas as palavras serão digitadas em letras minúsculas e cada elemento de P terão tamanho máximo de 100 caracteres. Para cada elemento de P caso seja possível formá-lo com os caracteres de S o programa deverá responder OK, caso contrário -1.

Miniproject Introduction to Programming

Miniproject of the Introduction to Programming course done in C language in my first year of course (2017)

The miniproject aims to deepen your knowledge of the C programming language, putting into practice the programming language, putting into practice the knowledge already acquired, from conditional conditional, repetition and multiple choice structures, functions and procedures etc. To do this you will develop a C program, based on functions, with the following structure:

When you run the program you should be presented with the following menu of options:

1 - Difference of the Sum of Squares

2 - Simplification of Fractions

3 - Operation between Binary Numbers

4 - Successor problem

5 - Statistical Data

6 - Word formation letter soup

7 - Exit.

The user chooses between one of these options:

1- The program should show the difference between the sum of the squares of the first N natural numbers and the square of their sum. For example: The sum of the squares of the first ten natural numbers 'e, 12 + 22 + ... + 102 = 385. The square of the sum of the first ten natural numbers 'e, (1 + 2 + ... + 10) 2 = 552 = 3025. Hence the difference between the sum of the squares of the first ten natural numbers and the square of the sum 'e 3025 - 385 = 2640.

2- Consider a fraction in the form N/M where N is integer (0 <= N <= 10000) and M integer (1 <= M <= 10000). The program should be able to simplify a fraction in this format such that the new numerator and denominator are minimal. The program will be given a test set consisting of an indefinite number of lines. Each line will contain the values of N and M separated by a space. The end of the input will be indicated by N=M=0. The output of the program should be the simplified fraction in the same order as the input one in each line separating the numerator and denominator by a space.

3- Make a program that can operate two numbers from 0-255 given in binary. The answer must also be given in binary. The following operators must be accepted: +,-,*,/.

4- Make a program that asks for integers I (-4000 <= I <= 4000) while I is non-zero. When I is zero the program should print all the immediate integer successors of each I entered. Notice that in this problem there is no limit to the number of I numbers entered.

5- Write a program that determines the histogram, mean and standard deviation of a vector of reals. The histogram represents, in an appropriate vector, the number of occurrences of n elements of the vector in each of k width intervals (max(x) - min(x))/k. The standard deviation, s, is a measure of dispersion of the elements of x around the mean, m , and is defined as:

image

6- Make a program capable of accepting a string S and a group of N words P. For each word entered, it must be verified the possibility of forming it with the letters of the string entered. Consider that: The words will be typed in lowercase letters and each element of P will have a maximum size of 100 characters. For each element of P, if it is possible to form it with the characters from S the program should answer OK, otherwise -1.

miniprojecto-introducao-programacao's People

Contributors

simmonsmoreno avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.