Free Essay

Visual Programming

In:

Submitted By onkyo
Words 516
Pages 3
Riphah International University, Faisalabad

Visual Programming – Assignment 2 Functions and Control Sructures
Instructions for Submission
Submission Guidelines: • Your code must be properly commented and your code should be neat and nested format. • All the steps involved in solution of each question should be written. Just Answers are not required • Try NOT to copy paste data from your friends etc. • This is an individual assignment. PLAGIARISM IS NOT ACCEPTABLE! In case of plagiarism you will get ZERO MARKS for that question • Please do not copy paste program from your friend. • Complete the assignment nicely and submit .cpp files on email you can zip all program in one file then submit that file • Submit files in format like “yourname_yourclass_q1.cpp, yourname_yourclass_q2.cpp”, other file naming convention will not be accepted. • Submit files on uzairsaeed@riphahfsd.edu.pk • Other questions except program can be solved on Microsoft Word or alike, and plagiarism is 30% with proper reference is allowed only • Last date of submission 02-October-2013 11:55 pm

Question 1: Write a function that receives 5 integers and returns the sum and average of these numbers. Call this function from main( ) and print the results in main(). Question 2: A 5-digit positive integer is entered through the keyboard, write a function to calculate sum of digits of the 5-digit number. Question 3: A positive integer is entered through the keyboard and taking input and terminates on sentinel value, write a function primeFactor that take argument of your input number and increment on even, odd or prime. At the end your program should display how many even, odd or prime numbers were entered. Question 4:
Instructor: Uzair Saeed 1

Riphah International University, Faisalabad
Given N and K write a function to compute the Binomial Coefficient. Pass the value of N and K to the function, calculating Binomial. [Hint]: Make an additional function of factorial as well. Your main will contain only a single function call. N! K! (N-K)! Question 5: Write a function with the name mypower that behaves exactly like pow function of math.h and a function factorial Question 6: Write a function that receives as input three integer arguments and then circularly shift their values to right your function can have maximum 4 variables. (The change in variables must be permanent) Example: If x=5, y=8, z=10 then after circular shift y=5, z=8, and x=10. Question 7: Write a function to obtain the first 25 numbers of a Fibonacci sequence. In a Fibonacci sequence the sum of two successive terms gives the third term. Following are the first few terms of the Fibonacci sequence: 1 1 2 3 5 8 13 21 34 55 89... Question 8: Write a C++ function to evaluate the series

Question 9: What are storage classes in Visual C and how many storage classes are there in this language. Explain with examples Question 10: What is inline function in Visual C++ explain with suitable example. Question 11: Define and explain recursive function with example and its benefits in programming.
Instructor: Uzair Saeed 2

Similar Documents

Free Essay

Visual Programming

...TABLE OF CONTENT Introduction_________________________________________________________________________1 GROUP REPORT________________________________________________________________1 Visual Application Sketch___________________________________________________________1 Menu Form_____________________________________________________________________3 Menu Form Codes_____________________________________________________________3 LoginCreate Form_____________________________________________________________________4 Login TabPage 1___________________________________________________________4 Create A New Account TabPage 2_________________________________________________5 LoginCreate Form Codes_________________________________________________________5 Customer Form__________________________________________________________________7 Customer Form Codes___________________________________________________________8 Advertise Form_____________________________________________________________________9 Advertise Form Codes_______________________________________________________10 Payment From_____________________________________________________________________11 Payment Form Codes_______________________________________________________12 Staff_Login Form_____________________________________________________________________13 Staff_Login Form Codes_________________________________________________________14 Staff Form_____________________________________________________________________15 ...

Words: 7080 - Pages: 29

Free Essay

Visual Programming

...1. using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Csharp_exercises { class Program { static void Main(string[] args) { int x,y,z; Console.Write("Enter value 1:"); x = int.Parse(Console.ReadLine()); Console.Write("Enter value 2:"); y = int.Parse(Console.ReadLine()); Console.Write("Enter value 3:"); z = int.Parse(Console.ReadLine()); if (x > y)    if (x > z) Console.Write("The greatest value is:{0}.",x);    else Console.Write("The greatest value is:{0}.", z); else if (y > z) Console.Write("The greatest value is:{0}.",y);    else Console.Write("The greatest value is:{0}.",z); Console.ReadLine();      }   } } 2. using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Csharp_exercises { class Program { static void Main(string[] args) { float quiz_score; float mid_score; float final_score; float avg; Console.Write("Enter quiz score:"); quiz_score=float.Parse(Console.ReadLine()); Console.Write("Enter mid-term score:"); mid_score = float.Parse(Console.ReadLine()); Console.Write("Enter final score:"); final_score = float.Parse(Console.ReadLine());  avg = (quiz_score +mid_score+final_score) / 3; if (avg >= 90) Console.WriteLine("Grade A"); else if ((avg >= 70) && (avg < 90)) Console.WriteLine("Grade B"); else if ((avg >= 50) && (avg < 70)) Console.WriteLine("Grade C"); else if (avg < 50) Console...

Words: 457 - Pages: 2

Premium Essay

Week 8 Discussion: Visual Basic Programming

...•Imagine that your company has decided to expand to the Web. You want to reuse some data entry code that has been developed in Windows and place it on the Web. Visual Basic code has the capability to run on a Web server. Explain the process you would go through to develop a Web page locally. You can create HTML pages and Web Forms pages as the user interface for a Web application. HTML pages are generally used for static content. In contrast, Web Forms pages give you a programmable interface that works much like a Visual Basic form, except that the user interface is rendered in a Web browser or other Web device. Web Forms pages are built on the ASP.NET Page framework. Each Web Forms page is an object that derives from the ASP.NET Page class, which acts as a container for controls. The page actually consists of two files: an .aspx file that contains the UI elements (static HTML text and control elements) and a class file that contains the code that runs the page. •Internet Explorer is the number-one Web browser, but many users are moving to Chrome and Firefox Web browsers. Each of these browsers has slight differences in displaying the screen content. Explain how this can occur to your Web screen and any ways to prevent this. Web Forms applications are, by definition, platform-independent — that is, they are "reach" applications. Users can interact with your application regardless of what type of browser they have and even what type of computer they are using. At the same time...

Words: 705 - Pages: 3

Premium Essay

Computers

...D. Introduction to Programming with RAPTOR By Lt Col Tom Schorsch The RAPTOR Programming Language RAPTOR is a visual programming language based on flowcharts. Flowcharts were developed as a design aid for developing programs; however, with RAPTOR they are a programming language in their own right as the flowcharts you develop can be executed by the RAPTOR development environment. We use RAPTOR in CS110 for several reasons. First, the RAPTOR language has minimal syntax (grammar) when compared with other programming languages. This makes Raptor programs easy to write as there are fewer language elements that you have to learn to be productive. Second the RAPTOR language is visual; RAPTOR programs are diagrams (directed graphs). One of the hardest aspects of programming to understand and get right is the flow of control of the statements in your program. The visual nature of the flow of control in RAPTOR programs makes them easier to understand and program. Third, we developed the programming language and development environment. We sought to make the development environment easy to use and the error messages that RAPTOR displays to you easy to understand. We are constantly trying to improve RAPTOR, so if you have suggestions please tell us. Fourth, our purpose is not to teach you how to program in particular language. We want to teach you how to design and execute algorithms to solve problems, and to implement algorithms using computer-based problem solving...

Words: 1922 - Pages: 8

Premium Essay

Cis-110 Technical Paper

...OOP makes it easy to maintain and modify existing code as new objects can be created with small differences to existing ones. OOP provides a good framework for code libraries where supplied software components can be easily adapted and modified by the programmer. This is particularly useful for developing graphical user interfaces. Concepts of OOP: Objects which included classes, data abstraction and encapsulation, inheritance, polymorphism. Purely in terms of total instruction path length, a program coded in an imperative style, without using any subroutines at all, would have the lowest count. However, the binary size of such a program might be larger than the same program coded using subroutines (as in functional and procedural programming) and would reference more "non-local" physical instructions that may increase cache misses and increase instruction fetch overhead in modern processors. The paradigms that use subroutines extensively (including functional, procedural and object-oriented) and do not also use significant in-lining (via compiler optimizations) will, consequently, use a greater percentage of total resources on the subroutine linkages themselves. Object oriented programs that do not deliberately alter program state directly, instead using mutator methods (or "setters") to encapsulate these state changes, will, as a direct consequence, have a greater overhead. This is due to the fact that message passing is essentially a subroutine call, but with three more...

Words: 873 - Pages: 4

Free Essay

Chapter of My...

...any computer. The program is also robust; phpMyAdmin has enough functionality that you can probably create and run a Web site without knowing any SQL. Being free and open-source never hurt anybody, either. For these reasons, most hosting sites include phpMyAdmin in their control panel as the default MySQL administration tool. phpMyAdmin has some nice extras, such as importing and exporting Excel, OpenDocument, and XML files, and a tool that generates a PDF image of your database schema. Visual Basic  According to Laud (2012) Visual Basic is a programming language and integrated development environment (IDE). It derives from the much older BASIC programming language, and so is considered a useful and relatively easy programming language for the beginner to learn. Visual Basic (VB) is now integrated into many different software applications and also web applications. Visual Basic was developed to be easy to learn, with a quick learning curve and a diverse scope of possibilities. Using the Visual Basic software, you can either hard-code or use the developer software to assist you throughout. It's also used to create ActiveX controls (for web usage and other controls), .dll file extensions or executables for standalone operation. LAN (Local Area Network) According to Rouse (2006) a local area network (LAN) is a group of computers and associated...

Words: 1499 - Pages: 6

Premium Essay

The History of Visual Basic

...The History of Visual Basic dates back to 1991 when VB 1.0 was introduced. The core of Visual Basic was constructed on the older BASIC language, which was the prevalent programming language throughout the 1980s. It's a computer programming system established and owned by Microsoft. Visual Basic was originally produced to make it easier to write programs for the Windows computer operating system. The basis of Visual Basic is an earlier programming language called BASIC that was invented by Dartmouth College professors John Kemeny and Thomas Kurtz. Visual Basic is often denoted by using just its initials; VB. Visual Basic is easily the most extensively used computer programming system in the history of software. Microsoft Visual Basic is the most common language and development environment for developers coding to the Windows operating system platform. From modest beginnings it has grown to be part of personal computing itself, and with the latest incarnation, Visual Basic .NET in Beta it looks as if it may be in use for another decade or longer. Visual Basic 1.0 for Windows was released in May 1991 at a trade show in Atlanta, Georgia. Visual Basic 2.0 was released in November 1992. The programming environment was easier to use, and its speed was improved. Visual Basic 3.0 was released in 1993 and came in Standard and Professional versions. Visual Basic 4.0 was released in August 1995. It was the first version that could produce 32-bit as well as 16-bit Windows programs. It...

Words: 409 - Pages: 2

Free Essay

Research

...INTERNATIONAL JOURNAL OF SCIENTIFIC & TECHNOLOGY RESEARCH VOLUME 2, ISSUE 9, SEPTEMBER 2013 ISSN 2277-8616 Game Development Of Ibong Adarna Visual Novel Celso T. Agos Jr., Mark Lester C. Bal-Ut, Lorraine G. Calam, Relly N. Cantuba, Marlon Heindric M. Vallo. Engr. Mary Regina Apsay Abstract: Computer games are becoming a main entertainment. But this research tackles about Visual Novel a kind of game that has extremely minimal game-play, story-driven, usually have multiple or branching storyline and is commonly developed and released in Japan. The proponents made a game based on a story tackled in high school, after they developed it; the high school students compared it with a Visual Novel that is made and popular in Japan. The results are; the Ibong Adarna Visual Novel has the advantage with a difference of .08 in the over-all weighted mean but after the statistical treatment, this score is not significant with the score of .017. Index Terms: Branching Storyline, Game, Game Development, High School Students, Ren’Py Visual Novel Engine, Story-driven, Visual Novel, ———————————————————— 1 INTRODUCTION In this past decade, computers revolutionized the way of living. Computers make our work faster, more reliable and more accurate. Computers can be in different form like mobile phone, tablet PC, or in the form of desktop computer. Computers help us in numerous ways; communication, transportation, education, entertainment and many more. While computers have entered millions...

Words: 4991 - Pages: 20

Premium Essay

Sped

...VISUAL IMPAIRMENTS describes a wide variety of conditions that affect vision abilities. We use the term to denote mild to most severe vision loss, rather than to defects in the eye itself. According to the Individuals with Disabilities Education Act (IDEA) of 1997, a visual impairment refers to “an impairment in vision that, even with correction, adversely affects a child’s educational performance. The term includes both partial sight and blindness.” Degrees of Visual Impairment: * Totally blind. This term usually implies little or no visual sensitivity to light at any level. This condition is rare, and people who are totally blind typically have severe physical damage to the eyes themselves or to the visual nerves. * Legally blind. A legally blind person has a visual acuity of 20/200 or less in the better eye, after correction. This means that what an individual with normal (20/20) vision sees at two hundred feet, the legally blind person cannot see until he or she is within twenty feet. In addition, a person can be classified as legally blind if she has a field of vision no greater than twenty degrees at the widest diameter. (A normal field of vision is close to 180 degrees.) Only about 20 percent of legally blind people are totally blind. Legally blind individuals typically use Braille and visual aids. * Low vision. People with low vision can read with the help of large-print reading materials and magnifying objects. They may also use Braille. * Partially...

Words: 2499 - Pages: 10

Free Essay

Wearable Obstacle Detection for the Blind That Can Detect Discrete Elevation That Uses Gizduino Microcontroller

...TITLE PAGE Wearable Obstacle Detection for the Blind that can Detect Discrete Elevation using Gizduino Microcontroller by Nicole Sam Rey P. Cuaresma Carissa D. Eustaquio Glenda T. Ofiana A Thesis Report Submitted to the School of Electrical, Electronics, and Computer Engineering in Partial Fulfilment of the Requirements for the Degree Bachelor of Science in Computer Engineering Mapúa Institute of Technology May 2015 ii iii ACKNOWLEDGEMENT The researchers would like to express their deepest gratitude to all those who gave contribution to the completion of this paper. To our adviser, Engr. Glenn V. Magwili, for his patience and efforts in stimulating suggestions and encouragement that helped the whole group in order to create a device that can help many people. To our former instructors who have taught us valuable knowledge throughout our academic progress.This research would also not be possible without the belief of the research panel members. The researchers would also like to thank the unconditional support, patience and understanding of their families throughout the process. To the researchers’ colleagues who had also given support and shared their knowledge during the course of completing the research. Lastly, to the Almighty God who had bestowed them with wisdom and strength throughout the research and their life. To the Lord who gave blessings and guidance for the success of this research. iv TABLE OF CONTENTS TITLE...

Words: 15527 - Pages: 63

Premium Essay

Unit 3

...Lab 3: Input, Processing, and Output This lab accompanies Chapter 2 (pp. 56-68) of Starting Out with Programming Logic & Design. Chris Garcia Name: ___________________________ Lab 3.1 – Pseudocode This lab requires you to think about the steps that take place in a program by writing pseudocode. Read the following program prior to completing the lab. Write a program that will take in basic information from a student, including their name and how many credits they have taken in Network Systems Administration program. The program will then calculate how many credits are needed to graduate. Display should include the student name and the number of credits left to graduate. This should be based off a 90 credit program, where some courses are half credits. Step 1: This program is most easily solved using just a few variables. Identify potential problems with the following variables declared in the pseudocode. Assume that the college has the ability to offer half credits. (Reference: Variable Names, page 39-40). |Variable Name |Problem (Yes or No) |If Yes, what’s wrong? | |Declare Real creditsTaken |n | | |Declare Int creditsLeft |y | | |Declare Real studentName ...

Words: 1394 - Pages: 6

Free Essay

Vp Short Report

...‘Visual Basic’ Developer: Microsoft Appeared in: 1991; 24 years ago OS: Microsoft Windows and Ms - DOS HISTORY: Alan Cooper, the 'father' of Visual Basic, shows a drag-and-drop shell prototype called Tripod to Bill Gates. Microsoft negotiates to buy the concept, now code-named Ruby. The Tool includes a widget control box, the ability to add widgets dynamically, and a small language engine. Visual Basic is Microsoft's high-level object-oriented rapid application development environment for the Windows platform. The first versions of Visual Basic were intended to target Windows 3.0 (a version for DOS existed as well), however it was not until version 3.0 for Windows 3.1 that this programming language gained large-scale acceptance in the shareware and corporate programming community. VB 1.0 was introduced in 1991. The approach for connecting the programming language to the graphical user interface is derived from a system called Tripod (sometimes also known as Ruby), originally developed by Alan Cooper, which was further developed by Cooper and his associates under contract to Microsoft. Visual Basic is a third-generation event-driven programming language and integrated development environment (IDE) from Microsoft for its COM programming model first released in 1991. Microsoft intended Visual Basic to be relatively easy to learn and use. Visual Basic was derived from BASIC and...

Words: 1610 - Pages: 7

Premium Essay

Term Paper 1

...Business Plan for Unique Expression Ricardo Stephens Unique Expression 1370 Windsor, California Ave. N9B 3A1 519-991-3201 stephenr @uwindsor.com * Table of Contents I. Table of Contents 1 II. Executive Summary 2-4 III. Situational Analysis.............................................................................................5-7 IV. Description on the Venture....................................................................................8 V. Production & Operations Plan............................................................................. ..9 VI. Marketing Plan................................................................................................10-12 VII. Management Overview.......................................................................................13 VIII. Assessment of Risk.............................................................................................14 IX. Financial Plan...............................................................................................15-17 X. Viability...............................................................................................................18 XI. Appendices…………………………………………………………….....…19-21 Executive Summary ...

Words: 3949 - Pages: 16

Free Essay

Pt1420

...Algorithm Workbench Review Questions: Programming Exercise Questions: 1) Personal Information Design a program that displays the following information: · Your name · Your address, with city, state, and ZIP · Your telephone number · Your college major Pseudocode: Display “Enter your name” Input name Display “Enter your address, with city, state, and zip” Input address, city, state, zip Display “Enter your telephone number” Input Telephone number Display “Enter college major” Input college major Input Information Console.Write("Enter your full name: ") name = Console.ReadLine() Console.Write("Enter your address, city, state, and zip: ") addressCityStateZip = Console.ReadLine() Console.Write("Enter your Telephone Number: ") telephoneNumber = Console.ReadLine() Console.Write("Enter your College Degree: ") collegeDegree = Console.ReadLine() Visual Basic Code: Sub Main() 'Declarations for variables Dim name As String Dim addressCityStateZip As String Dim telephoneNumber As String Dim collegeDegree As String 4) Total Purchase A customer in a store is purchasing five items. Design a program that asks for the price of each item, and then displays the subtotal of the sale, the amount of sales tax, and the total. Assume the sales tax is 6%. Visual Basic Code: Console.Title = "Total Purchase" Console.WriteLine("Input the...

Words: 290 - Pages: 2

Premium Essay

Programming Languages

...Exploring Programming Languages Computers don't do anything without someone telling them what to do, much like the average teenager. To make the computer do something useful, you must give it instructions in either of the following two ways. When you write a program it tells a computer what to do, step by step, just as you would like when taking directions. When you buy a program that someone else has already written, it tells the computer what to do. Ultimately, to get a computer to do something useful, you (or somebody else) must write a program. A program does nothing more than tell the computer how to accept some type of input, manipulate that input, and spit it back out again in some form that humans find useful. Table 1 lists some common types of programs, the types of input that they accept, and the output that they produce. The five popular programming languages in the 1970’s were Pascal, C, SQL, KRL, and COMAL. Pascal is an influential imperative and procedural programming language, designed in 1968–1969 and published in 1970 by Niklaus Wirth. C (/ˈsiː/, as in the letter C) is a general-purpose programming language initially developed by Dennis Ritchie between 1969 and 1973 at AT&T Bell Labs. SQL was developed at IBM by Donald D. Chamberlin and Raymond F. Boyce in the early 1970s. SQL often referred to as Structured Query Language. KRL is a knowledge representation language, developed by Daniel G. Bobrow and Terry Winograd while at Xerox PARC and Stanford University...

Words: 839 - Pages: 4