CS221 File Output Using Special Formats. What is a File? A file is a collection of information The type of information in the file can differ image, sound,

Slides:



Advertisements
Similar presentations
Introduction to HTML
Advertisements

HTML I. HTML Hypertext mark-up language. Uses tags to identify elements of a page so that a browser such as Internet explorer can render the page on a.
Learning HTML. > Title of page This is my first homepage. Tells Browser This is an HTML page Basic Tags Tells Browser End of HTML page Header information.
HyperText Markup Language (HTML). Introduction to HTML Hyper Text Markup Language HTML Example The structure of an HTML document Agenda.
Internet Services and Web Authoring (CSET 226) Lecture # 5 HyperText Markup Language (HTML) 1.
WeB application development
A guide to HTML. Slide 1 HTML: Hypertext Markup Language Pull down View, then Source, to see the HTML code. Slide 1.
ASHIMA KALRA.  WHAT IS HTML WHAT IS HTML  HTML TAGS HTML TAGS  FORMATTING TAGS FORMATTING TAGS.
How Tags are used to form your Web Page
1 eVenzia Technologies Learning HTML, XHTML & CSS Chapter 1.
Chapter 4 Marking Up With Html: A Hypertext Markup Language Primer.
CM143 - Web Week 2 Basic HTML. Links and Image Tags.
Introduction to HTML 2006 INT197B. What is the Internet? Global network of computers that are connected and communicate via a series of Protocols Protocols.
Creating Web Pages Getting Started. Overview What Web Pages Are How Web Pages are Formatted Putting Graphics on Web Pages How Web Pages are Linked Linking.
HTML Lesson 1 TBE 540 Farah Fisher. Prerequisites Before beginning this lesson, the student must be able to… Access web pages and navigate the web Access.
Copyright 2003 The McGraw-Hill Companies, Inc CHAPTER Application Software computing ESSENTIALS    
Chapter 2 Introduction to HTML5 Internet & World Wide Web How to Program, 5/e Copyright © Pearson, Inc All Rights Reserved.
Chapter 14 Introduction to HTML
Basics of HTML.
B.A. (Mahayana Studies) Introduction to Computer Science November March Office Tools A look at the main tools most computer users.
CpSc 462/662: Database Management Systems (DBMS) (TEXNH Approach) HTML Basics James Wang.
© 2012 Adobe Systems Incorporated. All Rights Reserved. LEARNING THE LANGUAGE OF THE WEB INTRODUCTION TO HTML AND CSS.
Chapter 4 Fluency with Information Technology L. Snyder Marking Up With HTML: A Hypertext Markup Language Primer.
Ku-Yaw Chang Assistant Professor, Department of Computer Science and Information Engineering Da-Yeh University.
Web Design Using HTML Codes. WHAT DO I NEED TO BEGIN DESIGNING A HOME PAGE? 1.YOU NEED A FOLDER (also called a DIRECTORY) You should set up a folder or.
DAT602 Database Application Development Lecture 14 HTML.
HTML. What is HTML?  HTML is a language for creating web pages.  HTML stands for Hyper Text Markup Language  A markup language has tags which are codes.
HTML Structure & syntax
CSCI 1101 Intro to Computers 3. Common Productivity Software.
Spreadsheet Introduction and Terminology Fill in the Listening Guide as you view this presentation.
 HTML stands for Hyper Text Mark-up Language. The coding language used to create documents for the World Wide Web  HTML is composed of tags. HTML tags.
1 CSC 121 Computers and Scientific Thinking David Reed Creighton University HTML and Web Pages.
 2008 Pearson Education, Inc. All rights reserved Introduction to XHTML.
File Name Extensions Computer Applications 7th grade.
Microsoft FrontPage 2003 Illustrated Complete Using Office Components.
SPREADSHEET BASICS SPREADSHEET BASICS What are the benefits of using a spreadsheet to solve a problem?
Just Enough HTML How to Create Basic HTML Documents.
HTML Hyper Text Markup Language. What is an HTML File?  HTML stands for Hyper Text Markup Language  An HTML file is a text file containing small markup.
INTRODUCTION. What is HTML? HTML is a language for describing web pages. HTML stands for Hyper Text Markup Language HTML is not a programming language,
1 What is HTML? Standardized codes Web pages SGML Descriptive markup Tags.
CS105 INTRODUCTION TO COMPUTER CONCEPTS HTML Instructor: Cuong (Charlie) Pham.
HTML Structure & syntax. Introduction This presentation introduces the following: Doctype declaration HTML Tags, Elements and Attributes Sections of a.
HTML: Hyptertext Markup Language Doman’s Sections.
4 Chapter Four Introduction to HTML. 4 Chapter Objectives Learn basic HTML commands Discover how to display graphic image objects in Web pages Create.
LEARNING HTML PowerPoint #1 Cyrus Saadat, Webmaster.
HTML file format  Lesson Objective: Understanding HTML and how it is used to create web pages.  Learning Outcome:  Create a HTML page by interpreting.
HTML ( HYPER TEXT MARK UP LANGUAGE ). What is HTML HTML describes the content and format of web pages using tags. Ex. Title Tag: A title It’s the job.
Introducing the World Wide Web Internet- a structure made up of millions of interconnected computers whose users communicate with each other and share.
Web Design. How do web pages work? Webpages are written in a code called HTML. Programs like Internet Explorer read the code, and then show it as a web.
HTML Basic. What is HTML HTML is a language for describing web pages. HTML stands for Hyper Text Markup Language HTML is not a programming language, it.
Basic HTML. So, what exactly is HTML? HTML stands for: HTML stands for: Hypertext Markup Language. It is a purpose built markup language for the delivery.
Introduction to HTML C151 Multi-User Operating Systems.
Hypertext Markup Language.  Developed by Tim Berners-Lee in 1990  Stands for HyperText Markup Languange  A format that tells a computer how to display.
Notes Test #2 will be held one week from this Thursday Check to see if you have a Vision account –Launch Netscape –Point & Click to location and type vision.
Introduction to HTML Simple facts yet crucial to beginning of study in fundamentals of web page design!
1 2/16/05CS120 The Information Era Chapter 4 Basic Web Page Construction TOPICS: Intro to HTML and Basic Web Page Design.
XP 1 HTML Tutorial 1: Developing a Basic Web Page.
Introduction lab1. Suzanne J. Sultan 2 What is HTML? The definition of HTML is Hyper Text Markup Language. HTML is a computer language devised to allow.
HTML AN INTRODUCTION TO WEB PAGE PROGRAMMING. INTRODUCTION TO HTML With HTML you can create your own Web site. HTML stands for Hyper Text Markup Language.
HTML Help book. HTML HTML is the programming language used to make web pages for the Internet. HTML stands for Hyper Text Markup Language. HTML is made.
Glencoe Introduction to Web Design Chapter 4 XHTML Basics 1 Review Do you remember the vocabulary terms from this chapter? Use the following slides to.
Online PD Basic HTML The Magic Of Web Pages
Web Basics: HTML/CSS/JavaScript What are they?
Introduction to XHTML.
Microsoft FrontPage 2003 Illustrated Complete
Web Design and Development
What is HTML?.
AN INTRODUCTION BY FAITH BRENNER
WJEC GCSE Computer Science
Presentation transcript:

CS221 File Output Using Special Formats

What is a File? A file is a collection of information The type of information in the file can differ image, sound, video, text, web page, etc… Files are created, modified, and read by programs File extensions help the user AND the computer determine what type of information is in the file and what program is most suitable to use that file jpg, mp3, mpeg, txt, html, doc, xls, ppt, …

File Formats You can write a C++ program which can read and write files using file streams It is possible for your C++ program to read and write files which have special formats IF the programmer is aware of the format… Thus, if you know the format of an HTML file, you can write a C++ program which will read OR create/write a web page!

HTML and CSV These are special file formats which are based on plain text HTML is the format of Web Pages CSV is a format which can be used by MS Excel We will learn how to make our C++ programs create files using these formats

MS Excel in Brief Microsoft Excel is a Spreadsheet Program The spreadsheet consists of a grid of rows and columns rows are numbered, columns are lettered When a row and column meet, there is a cell cells are identified by their row and column A1, E5, C13, etc… Cells can contain data (text or numeric) or formulas which act upon that data

MS Excel in Brief Useful engineering aspects of Excel store and organize a moderate amount of data make calculations on that data make graphs to analyze data

Graphing in Excel Store data in columns with labels at the top Select (click+drag) the data series you want to graph Click the graph wizard button follow simple directions to creat the graph you can make your graph “fancy” axis labels, graph label, key, etc…

CSV Files CSV stands for “comma separated value” CSV is a special file format Microsoft Excel can recognize and open CSV files Your C++ program can use a file output stream to create CSV files

CSV Files In a CSV file, Excel will read the text in the following way… each comma encountered in the file will move Excel to the next cell in the current row each new line character (endl) encountered in the file will move Excel to the next row

CSV Files Example

Using File Output with CSV You can output from your C++ code to a csv file, then open that output file up in Excel and graph, calculate, etc… (as long as the format is correct) Code to produce the preceding example ofstream fileOut; fileOut.open(“test.csv”); fileOut << “Time,Velocity,Acceleration” <<endl; fileOut << 1 << “,” << 2 << “,” << 3 << endl; fileOut << 4 << “,” << 5 << “,” << 6 << endl; fileOut << 7 << “,” << 8 << “,” << 9 << endl; fileOut << “,,” << 10 << endl;

Web Browsers in Brief Web Browsers are Special Programs which interpret Web Pages and display the results graphically Explorer, FireFox, etc… Web Browsers give users the ability to access information which is stored in remote places and see it on their computer quickly and efficiently

Web Browsers in Brief Useful engineering aspects of Web Browsers make data available to colleagues/the public present data to non-engineers in a familiar format

HTML Files HTML stands for “HyperText Markup Language” HTML is a special file format Web Browsers can recognize and open HTML files Your C++ program can use a file output stream to create HTML files

HTML Files In an HTML file, the browser will read the text and produce a web page by interpreting “tags” each HTML tag tells the browser to do something different with the data it is reading we will learn a VERY SMALL set of HTML tags for a complete list of HTML tags, see this link

More About Tags Each HTML tag is enclosed in angle braces Many HTML tags must be accompanied by a closing/ending tag, which looks the same as its opening/beginning tag, but is marked by a slash Think of a tag set as a set of bookends, anything between the opening and closing tag is described by the tag set.

Some Important Tags - marks the beginning and end of the HTML file - tells the browser what to display as the page’s title - marks the beginning and end of the web page’s body (where the contents to be displayed are located

Some More Tags - tells the browser that this text is a heading (can also have h2 through h6 for smaller sized headings) - tells the browser that this area of text is to be bold, underlined, and/or italic respectively - begin a new paragraph in the text

TableTags - tells the browser to begin a table (if border is 1, show the border, if border is 0 don’t show it) - start a new row in the table - start a new data entry (cell) in the table

HTML Files Example

Using File Output with HTML You can output from your C++ code to an html file, then open that output file up in a standard web browser as long as the format is correct.

Using File Output with HTML ofstream fileOut; //declare output file stream fileOut.open(“test.html”); //open file, NOTE extension fileOut ” <<endl; //begin html page //output title tag fileOut Testing Results ” << endl; //output heading fileOut Results of Test Run 1 ” << endl; fileOut ” << endl; //begin page body //first paragraph fileOut These are the test results from “; fileOut Test Run 1. ” << endl; //continued on next slide…

Code Continued… //begin a table with visible border fileOut ” << endl; //output first table row (table header) fileOut ” Min” Max” Reading”<<endl; //output subsequent table rows with data in them fileOut ” 0” 20” 15”<<endl; fileOut ” 0” 20” 10”<<endl; fileOut ” << endl; //end the table fileOut ” << endl; //end page body fileOut ” << endl; //end html page