Giter VIP home page Giter VIP logo

battle-ship-info's Introduction

Battle Ship Info Program (C Language)

Created on 2/1/2018

What is it?

A piece of code that stores the entered Battle Ship information and performs simple calculations.

This simple program is written in C language. It will:

  • Ask the user to input the information into an array of structure.
  • Display the ships as the original order in a table-like format;
  • Calculate the average values for numGuns and displacement, and display the result.

Example

Example of data:

NAME TYPE COUNTRY NUMGUNS BORE DISPLACEMENT
Bismarck bb Germany 8 15 42000
North Carolina bb USA 9 16 37000
Tennessee bb USA 12 14 32000

Inputing data:

What the output looks like:

How to run this program on your computer locally?

Windows operating system

  1. Open the Command Prompt
  2. Test if you have gcc installed by typing gcc -v. If it is not installed, please install gcc https://gcc.gnu.org/
  3. Go to the source code directory
  4. Compile the source code gcc -o program BattleShip.c
  5. Run your program program

Macintosh operating systems

  1. Open terminal
  2. Install the command-line tools: xcode-select --install
  3. Go to the source code directory
  4. Compile the source code gcc -Wall -o program BattleShip.c
  5. Run your program ./program

battle-ship-info's People

Contributors

tphuong141607 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.