Are There at Least Two Sides to Every Issue?

There is quite a bit of discussion on whether both sides of an issue should be presented, or should the people who control the discussion platform have the responsibility to publish only one side? This has been an argument going back as far as human history has been recorded. I am sure some people can recite Biblical or other early religious texts on the conflicts of two different sides. In the beginning, I will give examples in science and computer science.

One of the earliest discussions was on whether the earth was flat or round. The general belief was that the earth was flat, but some early Greeks, like Pythagoras, proposed that the earth was round. The majority of people said at that time that saying the world was round was nonsense. The earliest person to measure the circumference of the world was Eratosthenes of Cyrene, a Greek polymath, poet, astronomer, mathematician, librarian, and geographer. His measurement was very accurate. See “Who Was The First Person To Accurately Measure The Circumference Of The Earth?” for an excellent description of how Eratosthenes was able to calculate the circumference. Even after the circumference was calculated, the “experts” and “authorities” still insisted that the earth was flat. Anyone who disagreed was excommunicated or burned at the stake. a very effective way of eliminating any views that the people with authority did not like.

At the start of the 20th century there was quite an upheaval in physics. In 1900 most physicists believed that Newtonian Mechanics/Physics was the ultimate answer to answering all questions about motion. They likewise believed that the universe was filled with a substance called ether. that was needed for the transmission of light Since the people who believed in these theories were in charge of the Physics Journals of the time, they thought that any article that went against these theories should not be published. Think where we would be now if we did not know that the universe was a vast vacuum and without the Theory of Relativity by Albert Einstein being published. Albert Einstein eventually modified his theory and there have been additional discoveries confirming and modifying aspects of the theory over time. There may eventually be an entirely new theory created that allows for “Warp speed” space ships. Currently Einstein’s Theories are the basis of all new developments. If we disallow alternate proposals or theories from even being considered, would that help or hinder the advancement of Physics (which will also affect the welfare of mankind)?

All fields, to progress, have to have competing ideas. Any field that does not have competing ideas will eventually die out. I have been working with Computer Science since I was in high school and seen many major changes. Computer languages have progressed from binary through assembler and then Formula Translation (FORTRAN) to Structured and Object Oriented Languages. Their progressive development has led to significant developments that have helped computers help mankind in many ways. A short history of Software Languages is available on this site. The biggest controversy I remember is deciding what is the best way to develop code. The biggest conflict was between Structured Design and Agile Programming. There were cultures built around each approach, but at least the Computer Journals were open to presenting all ideas. I believe the best solutions are created through discussions and the adaptation of the best ideas. One compromise, which leans more to the Agile side, is the Scrum Methodology.

Does anyone remember speech and debate classes in high school and college? The one thing I remember being assigned is to research both sides of any controversy, from abortion through nuclear power. Researching both sides helped me understand the pluses and minuses on each side. Understanding both sides helps me make a clearer choice on each subject. That choice usually resides at some point between the two extremes. This really helps me understand where and why friends have their positions. It does not mean I will always agree with my friends but it helps us have civil conversations and gives me a good opportunity to understand different points of view.

For the longest time journalism always presented both/multiple sides of any issue. Universities were based on the Socrates method of discussion and that method carried over to journalism. There are now articles about the evils of Bothsidesism and how if you present both sides of a discussion, it will never lead to anything good. The article is written in such a way as to make one side look virtuous and the other side being represented as to make it look ridiculous. Unbiased facts are not needed and not really wanted. Look at some recent events. J. K. Rolling made the observation that Women have Periods, but that was against the current concept that gender is fluid. Therefore it must be stopped. What about what recently happened at the New York Times. The New York Times used to make sure that both sides were covered in the editorial page. Controversial editorials were published with editorial comments, especially if the editor disagreed with the premise. As long as editorials were on the editorial page and not the news page, that was fine. The most recent article is Senator Tom Cotton: Send In the Troops. The editor disagreed with the content of the editorial, but decided to publish the article so that people would better understand what the other side thought. As a result, the New York Times senior editor resigns amid backlash over controversial op-ed. Leadership does change, it can be nice to make sure that all opinions published match our own thoughts, that they reinforce our own beliefs. What happens if the leadership changes and a different philosophy now rules a particular organization. Will we like shutting down opposing thought as much if the supported thought no longer matches what we “know is true?”

The latest battleground is the internet. No one should be allowed to yell fire in a crowded theater when there is not fire. But if there is a fire should someone be allowed to take control of the situation and make sure people exit the theater safely? Just because someone does not like the idea of someone else noticing a fire, that does not mean it should not be mentioned. Russia has a simple solution for the internet, ban internet access to the common citizen. China has another solution, they have worked with Google to filter what their citizens can see. They also have a “good citizen” score that gives or removes rights to each citizen. Do we really want something like that in the United States? The First Amendment of the Constitute deals with free expression. That God-given right is vital to the survival of our country. Having an open and honest conversation is key to keeping us well-informed and able to make decisions that are good for us and for those around us. Censorship did not work through book burning, it will not work now either.

Developing a good understanding of our own opinions and thoughts, what we truly believe is right, is like weightlifting. It takes resistance to develop. The other benefit is that we may learn something. One such article for me was Why You Should Stop Saying “I Don’t See Color”. This article helped me refine my thoughts so that I can be more sensitive relating to people different than I. We all need to be pushed some and not become too complacent. We all need to hear both sides of each story and develop our own philosophy. Paraphrasing something that was said at the West Point 2020 graduation: “to be understood we must first seek to understand.” We each are individuals with attributes that may affect who we are. It is our responsibility to learn and grow. Complacency and censorship leads to nothing good. It is odd that the people who strongly protested book burning and who are in favor of the right to choose in certain areas are the most restrictive to the expression of views that do not agree with their world view. Providing the platform for free and respectful discussions is the best way to grow. Listen to different views. Those who do not will condemn themselves to a stagnant life. Also be aware of the difference sides of any story, then choose wisely as to which one is the most correct. But do not condemn others for coming to a different conclusion. Ask questions to understand why they believe the way they do. In having them explain their thoughts, each of us may have much more influence on others.

Posted in Uncategorized | Tagged , , , , , , | Leave a comment

Using Teams to Hold Online Meetings

Since we will all be required to create online content and hold on-line meetings while CECFC is closed, I decided to research as much as I could on how to hold and record meetings. The Microsoft documentation is good, but it has a few different features than our version of Teams (i.e. a Meetings tab instead of a Calendar tab on the left side of the tool). An example of their tutorials is:

I had to do a little research to plan for my class. I decided to create my own YouTube Channel to share what I have learned. My first video is:

Brady Taylor asked me to create some training for Microsoft Word and Excel. I am learning how to do that online and would enjoy teaching students various aspects of technology, including how to create YouTube channels and share appropriate content on it. There are several things students should know before graduating from high school/community college. This includes basic Microsoft Office skills, basic maintenance for Microsoft Windows and Linux systems, fundamentals of setting up a website, general programming principals, graphic design, etc. It would be nice to have an introductory course that these topics could be presented and then encourage our students to go more in-depth in the areas that they enjoy.

Having two teams at the same meeting

I have looked through the Microsoft Documentation and I could not find anything about having a meeting with two teams. I did find a work-around for that. It consists of adding the other class’ members as members of the first class and them including them on the calendar event. Remind students that they have to accept each meeting to be notified of the meeting. Following is how I combined two classes. If anyone has a better way, please let me know and I will redo the video.

Making a recording Available to Multiple Classes

This is a simple task. Go to the video you want to copy and do the following:

  1. Click on the triple periods to the right of the video
  2. Select “Link”
  3. A dialog box will appear, then click the Copy button
  4. Go to the class where you want the video shared
  5. In a box where you can enter text, right-click and select “Paste”
  6. Wait for the video to fully download, then send the message to your students.
  7. Your students should now be able to follow the link to Microsoft Streams and watch the video in their browser

One word of warning, the videos are stored in Microsoft Streams and are easy to delete. leaving a link in Teams with no accompanying video.

Posted in Microsoft, Teams, Uncategorized | Tagged , , | Leave a comment

Who Is the Customer?

This is a question that has been asked in business since there were any businesses. It is obvious that the people who pay the way and the financial shareholders have to be happy to have the business do well. But are they the most important to keep a business going strong? Let us take a look at a couple of organizations. The first one is in the airline industry. Have you ever flown? How do you feel about each airline? In college and when I worked for Hewlett Packard, I usually flew on United or Continental (because that is with whom HP had contracts). In Guam, I enjoyed Pan Am and Continental Air Micronesia. On personal business, I almost always took Frontier Airlines. Unfortunately, they have changed with regard to service to customers and the happiness of employees. I now take Southwest, whenever possible. The reason is because of their service. There are some aspects of the “cattle” loading I do not like, but the people are all great. Could that come from the ideals of the Southwest CEO? There is a fascinating article in Forbes entitled Employee-First Approach is Key to Customer Service Success Herb Kelleher, of Southwest Airlines, stated: “Years ago, business gurus used to apply the business school conundrum to me: ‘Who comes first? Your shareholders, your employees, or your customers?’ I said, ‘Well, that’s easy,’ but my response was heresy at that time. I said employees come first and if employees are treated right, they treat the outside world right, the outside world uses the company’s product again, and that makes the shareholders happy. That really is the way that it works, and it’s not a conundrum at all.”

I remember several conversations I had with Rulon Stacey, who was CEO at Poudre Valley Hospital, about how he turned around Poudre Valley Hospital. It seemed that the previous CEOs turned over quickly until Dr. Stacey brought in a new Philosophy. It is best to put it in his own words.

One of Dr. Stacey’s inspirations was the philosophy of Malcolm Baldrige. He researched the Malcolm Baldrige National Quality Award and submitted the application for 2008. Poudre Valley Hospital won the award that year. Rulon would be the first to admit that it was a team effort to win the award, work by all members of the hospital at all levels. The Malcolm Baldrige Award is a very prestigious award that is awarded to health care organizations, educational institutions, and businesses. It is something that all should strive to attain.

As was shown by Southwest Airlines and Poudre Valley Hospital, companies who treat their employees well thrive. Good employees will go out of their way to help customers, which in turn will help the entire organization.

Posted in Uncategorized | Tagged , , , , | 2 Comments

What are you Hearing that has not Been Said?

Inspiration comes in many forms. It is a gift that everyone alive can access. There are many names that inspiration has been given, including enlightenment, insight, personal revelation. Each word has slightly different meanings, but we will call it inspiration for this article.

Inspiration sometimes comes when we least expect it, but it often depends how we have prepared to receive it. From my experience, inspiration often comes to those who have “studied out” the problem to be solved, looked for possible solutions, and who live by consistent and basic principals. Beyond these basics, there are no formulas to receiving inspiration. The title explains how inspiration often happens. We may be thinking how to solve a problem or listening to others talk about some related topic. If we incorporate what we are hearing with our thoughts about what needs to be solved, we can surprise ourselves with elegant and unique solutions to our problems. This can apply to both academics and to our personal lives.

When we are learning a new subject, at first it can be very frustrating, but attempting to do something hard and listening to those who have done it before will give us insights that will often exceed the sum of the words said and the work we have currently done. We have all experienced “ah-hah” moments where “all of a sudden” something on which we have been working makes a lot more sense. All these inspirations are important to us, some are important to our community, and some are important to the entire world. Those inspiration that are important to the entire world usually come in layered inspiration, with the “break through” inspiration coming at a time that is right for people to understand how the results of the inspiration can be used for good. Unfortunately, there will always be some who use it to fight what is good. To continue to be inspired, we must always use the results of our inspiration for the best possible purpose. In recent history, inspirations led to such devices as the television, computers, flat screen televisions and displays, hand held devices, and eventually cell phones. Think about the order of the invention of these devices. Was the order important? Could cell phones be the compact instruments they are today, without the invention of the other items in this list? Inventions are often based on what has been already invented and asking “what if”, “what problem needs to be solved”. and “how can these inventions be combined and be used differently?” Thinking about what we are learning and living a principled life will give us insights that are important to us but are not always related to what we are hearing or what we think we are trying to solve. Thus the importance of the question: “What are we hearing that has not been said?”

Inspiration can be beneficial to personal safety as well as learning and personal growth. How many of us have been inspired to take a different way home or leave at a different time than we were planning to go? Then we learn later that something bad happened when we would have been at a particular location. I was visiting a friend in Los Angeles and was scheduled to take a particular Pan Am flight on 6 August 1974 back to Guam. Chuck and I wanted to talk a bit longer and play a game of tennis, so I changed my flight to TWA a bit later in the day. As we drove to the TWA terminal, we drove by the Pan Am terminal. Someone had put a bomb in the lockers which were in the terminal lobby and it went off about the time I would have been going through the airport. Three were killed and 36 were injured. I am glad I was inspired to have that game of tennis. As we recognize when and how inspiration comes, we will receive more inspiration.

Since I teach school, inspiration is vital to myself and my students. For me, to know what to teach when and how to better understand when students do not understand an important concept which will be needed later in the class. For the students, it is important to have insights about how to solve either assigned problems or personal projects. Often the insights are not what is being said but what is being heard. Believe it or not, they are not always the same. Sometimes it is just a thought that comes to a student that solves a problem. When I was a student, I can now look back and see when this happened to me. I also see it with some of my students, where someone is struggling on a new concept, one of the other students or I say something that might or might not be related to solving the problem, and the student will suddenly come up with a idea to solve the problem. When one student receives inspiration, I encourage them to share that with other students. Insights will build on each other and both students will come up with a solution that is far better than either one could develop on their own. This is true inspiration.

Know that each of us can receive inspiration when we need that inspiration. It may come all at once, or step-by-step. It often comes as a whisper or thought. We need to live in a way that will invite that inspiration into our lives. It will help us succeed in the things that are important in life.

Posted in Attitude, Becoming, Do, Inspiration | Tagged , , | Leave a comment


Knowing how to interview for a computer programming/design position is almost as important as the learning how to program. Over the years, I have had friends who were excellent programmers, including the design process, who lost out to people who were skilled, but far better interviewers. Know what the company wants far before you go in for an interview. If you have friends at the company, find out as much as you can about the types of interviews that are given and what is to be expected in the interview. Research. Always be honest in your answers, with a confidence that you can come up to speed in the new position as quickly as possible. Starting a new job is saved for another article, but just be ready to work hard to come up to speed as quickly as possible, to make yourself as valuable to the company as you can as quickly as you can.

Information Interview

One way to find out more about a company is to do information interviews. The basics are to develop a list of questions about a particular company that you think will help you better understand the company. Find a person who would know the answers to your questions within the company, go through the proper channels to ask the person for an information interview. Remember this is only an information interview, it is NOT a job application or interview. Be up-front as to how much time you think the interview will take. Still to that schedule, unless the person wants to tell you a bit more. Ask your questions, take good notes (you will not remember more than about 15% of what you heard if you do not write it down (or record it) during the meeting. Always write a thank you after the interview.

Interviews with Practitioners

I am in the process of interviewing people who developed systems (usually based on Software) that helps their customers accomplish needed tasks.

Oracle – Chris Branchflower

The first person I interviewed was Chris Branchflower, a manager at Oracle. One of the tasks his team does is developing applications that are used internally. My purpose of this interview was to find out how his company interviews candidates.

Software Mr. Branchflower’s Group uses

  • Oracle JET, an internally developed JavaScript Extension Toolkit.
  • JavaScript
  • TypeScript – tighter form of JavaScript, helps user be more precise in coding.
  • Templates and libraries to reduce redundancies
  • NetBeans IDE with built-in handling of Oracle JET.
  • HTML and CSS
  • Beyond Compare for side-by-side code comparison. It can compare individual files or each file in a given directory one file at a time.
  • Limited use of Java and C++ (mostly for legacy code)
Most of Oracle’s internal products are moving to web-based tools. This is why there is an emphasis on web development tools (like Oracle JET and JavaScript). They are also looking for code that uses similar algorithms where they can create templates or generics to write the algorithm once and use it for multiple data types. Similarly, class libraries that can be reused are also important to good development (do not reinvent something that can be reused). Templates and libraries can be fixed n one place and be corrected every place each are used. They always use peer reviews on all new or corrected code.

Recommended Sites and concepts for Interview Preparation

  • Freecamp Interview Suggestions
  • Know what peer review is and how to use it
  • Have good comments describing the code and modifications to the code at the start of the file.
  • Never use generic names, always us specific names that describe what is being done or what the variable contains.
  • Know what templates (C++/JavaScript) or generics (Java) are and how to use.

Interviewing Hints

It is good that candidates know several different computer languages. It can help people look at problems in different ways and come up with better solutions. Go through the information above to be better at interviewing. The way that Oracle tests applicants their knowledge of programming is to open a window with code that has problems. They will tell you what is desired for the code to do. You are responsible to fix the code. Follow the previously given rules on good coding standards. The site records your every key stroke. Type in the code. never copy the code from another page and then paste the solution into your code. If you paste a chunk of code, that sends up “red flags” and the interview will not go well. The key is to be confident in your own knowledge and present it well. Most interviewers can see through exaggeration or fraudulent clams. Be yourself and know the material the best you can.
Posted in C++, Code Reviews, Computers, Java, Software, Uncategorized | Tagged , , , , , , , | Leave a comment

Are You Fair Dinkum?

Are you “Fair Dinkum” or do “you seek confirmation of the genuineness or truth of something” or do you just “go with the flow?” In Australian, this phrase means a bit more, to have total commitment to what we are doing. Do not be lukewarm, be hot or cold. Bilbo Baggins of Bag End, is the protagonist and titular hobbit of the story, the Hobbit. He was asked to go on a great adventure by Gandalf, but had to leave right away. In many ways we are like Bilbo Baggins starting a new adventure when we start a new project or when we start a new job. Are we totally committed, or do we have in the back of our minds that I can always try something different. Even if the project will be over quickly or the job is not our desired job, intend to contribute as much as possible and learn as much as possible. People with whom we work will be grateful and be willing to help in the future. Some of these people become some of our closest friends. If we do not fully commit, this will never happen. When we work with others, our goal should always be to do what is best for ourselves and for others we work with and serve.

Notice that in this article I prefer to use the terms I and we instead of you. There are two reasons. This applies to me as much as to anyone else. Another reason for this is that when a person uses “you” to start a sentence it may make the other person feel less. Part of being fully committed is to be fully committed to good communication. I teach computer science, many of you who are reading this are students in these classes. As an example of this, which feels better? 1) “I noticed a problem with the code that was produced, to solve that problem, the solution is to …” or 2) “You know better than doing that, you have made that mistake so many times.” Which seems better? Which would each of us prefer hearing? How should we talk with others? 1) “I feel concerned about…” or 2) “You always…” Choose words wisely in working with others. Be totally committed to be “Fair Dinkum.”

I am very impressed with my CSC160 class, each student is dedicated to learning new material and doing it well. I enjoy this group and hope I can work with them second semester. There are many aspects of life that can be related to an acorn. Acorns cannot do much at first, but as they blossom as a tree they can produce so much more, including eventually producing other acorns. Using the computer programming example, as we learn new concepts, we can first implement those concepts in our programs, eventually we can go from using the exact code to using the concepts presented to produce new code, then eventually teaching other people how to best use these new concepts (being the producer of more acorns). Are you Fair Dinkum?

Act on best Instincts (or GUT) and not Intentions. Our intuition works far better than our intentions in making good choices. We all have choices, some are good, some are better, and a few can wind up our best decisions. How do we weed out the best solution in a reasonable amount of time. Each situation is different and requires intuition to solve the problem. Even with the best of plans, we are not guaranteed success the first time around. Failure is one of the biggest teachers to bringing success. When Thomas Edison set out to invent the light bulb, he was not successful for at least 5,000 times. When asked about his “failures” he said that he had not failed but learned 5,000 ways to not create a light bulb. As we learn new skills, we will probably learn many ways that will not solve the desired goal. Those attempts are great learning experiences, treat them as such. To be successful, have high concerns and high expectations. Be Fair Dinkum!

Desired solutions change as we learn more. Some new solutions are more difficult to find than solutions we can base on intuition and past experiences. Whenever we come across a tough situation we think we may have not encountered before, look for similarities to solutions we have developed previously. Other people in our organization may also have ideas on how to solve problems. Freely share ideas. We are all better together. As long as we do not worry about who receives the credit, so much better solutions are created. We each need to be our best to encourage others to be. Share knowledge and experience and others will usually do the same. Occasionally we each come across someone who does not freely share, Usually there is a reason for this. Help each other to be the best to have the best possible team to come up with the best possible solution. No one is the keeper of all good ideas and decisions. Be careful and caring, help those who are in new positions that they have not held before. succeed. We are all in this together. From past experiences leading teams, it is vital that the leader listen to all stakeholders and make decisions that are best for all members of the team. Decisions need to be made, but members of the team will have information that is vital to creating the best outcome for the team. Be Fair Dinkum!

Posted in Uncategorized | Tagged , , , , , , , | Leave a comment

Choosing a Career

In order to choose a good career with which you will be happy, start looking at your options early in your schooling. There are several aspects to consider. One of the most important is researching whether the area is increasing or decreasing. There is nothing worse than working hard to gain the knowledge in a field that is disappearing, or minimally not growing. My father wanted to be an astronomer, until he found that the only way a person obtains a job in astronomy is to have the current astronomer die or quit. There was not a lot of opportunity there for a future. He decided to study nuclear physics and that was a very important field in the 50s and 60s. Because I admire my father, I started following his footsteps but upon some research I discovered physics was no longer a growing field. I had the opportunity to work with a computer between my junior and senior year of high school. That is the basis of why I chose Computer Science as my career. Find something you really enjoy doing and then explore possibilities in thate field.

One quote that I recently saw, but did not see who said it fits in with choosing a career that you love;  “You often feel tired, not because you have done too much, but because you have done too little that sparks a light in you.” If any of us feel tired, look for a possible cause in how we spend our days.

You need to also explore for what type of company do you wish to work. Do you even want to work for a company or do you want to start your own business? IEEE (The Institute of Electrical and Electronics Engineers) Spectrum has an excellent article discussing the differences between working for a large corporation and a startup. The article is titled Software Engineering Grads Lack the Skills Startups Need. This article describes some of the differences between working for a large corporation and a small startup. Some of the skills needed in a small company are actually important no matter where you work. They are especially important if you start your own company.

The best gauge for each of us to determine what we would enjoy the most, is knowing our own strengths. Do you know in what areas you are good? Are you exploring different areas? While in high school, explore as many different areas as possible. If you find something you enjoy, explore it even more. Know your own interests, strengths, and skills. Develop your own passion. Ted Talks are a good area to explore different ideas. One on career choices videos is excellent on students finding their own strengths and building on those strengths. It is  by Chris Wejr:

What are your strengths? How can you best use them? How can you help you teaches help you develop these skills? Have you talked with your teacher about your strengths and interests. Most teachers want to help you succeed. Be the best advocate for what is best for you. Come with a good attitude and do your best. Have the grit to accomplish anything. Be your best in all things.

Posted in Attitude, Becoming, Do, Goals, Mentor, Planning, Self-Worth, Serving, Uncategorized | Tagged | Leave a comment

What is the main difference between C and Fortran?

The answer here is based on FORTRAN IV, the version of FORTRAN with which I have the most familiarity. The newer FORTRANs may have fixed the following problems.

FORTRAN simply means Formula Translation. It is one of the first languages developed after Assembly language. It is more prone to spaghetti code than C since there is no “structure.” FORTRAN was a great development when it was created. It was the first language I learned and I programmed several major projects with it. But it is not a structured language like C.

C is a structured language based on Algol and developed by Bell Laboratories to develop the UNIX operating System. A structured language has indentations and blocks of code surrounded by curly braces “{“ and “}” that indicate the beginning and the end of each block of code.

FORTRAN passes all variables to subroutine by reference. This means that when the variable is changed in the subroutine it is also changed in the calling program, something that can cause problems. C allows calls by either reference or value. By value is the default. By value passes in the value of the variable in the calling routine and then assigns that value to a variable locally defined in the subroutine. C also allows you to recursive call a subroutine. This cannot be done in FORTRAN IV.

Posted in C, Computers, FORTRAN, Software, Uncategorized | Tagged | Leave a comment

The Memory Module for the Saturn V rocket

The Saturn V rocket went to the moon in the summer of 1969. Think about the technology back then and how hard it might have been to program the controls for a rocket that was to fly to the moon and back. The astronauts had not control over the flight of the rocket. It was all done by a computer program dependent on memory made up of individual iron cores that were either magnetized for a “1” or demagnetized for a “0” with the additional knowledge that every time an iron core was accessed, it would demagnetize. The programmer had to remember to rewrite the value into each iron core every time it was accessed.

Videos and Descriptions

YouTube has several good videos describing the memory on the Apollo Saturn V’s. The first one describes the memory module:

and Saturn V Computer ring:

in the rocket itself. The second one describes the Apollo rope memory. Advertisements may come up at the start of the videos, since they do not allow embedding. Skip the ads. I will create a Discussion group in either Teams or D2L to allow you to comment.

Re-entry of Apollo XIII

Apollo 13 had a major catastrophe on its flight to the moon. The final problem was that the heat shield was damaged in the explosion. If it failed, the module would not be able to re-enter. Most re-entries took about three minutes for radio silence. After four minutes of silence, the people in the Houston ground-center became very worried.

Margaret Hamilton

Programming of the Saturn V was difficult. It had room for the large ring containing the computer. Think about the Lunar Lander. Every ounce counted, so the computer had to be much smaller and the program had to be very precise. Margaret Hamilton was the person who had the astronauts lives in her programming skills. She had the privilege of celebrating when the first lunar lander landed and took off safely.

Posted in Uncategorized | Leave a comment

Adding File I/O to a C++ Program

We have already covered console reads from the keyboard and writes to the display using cin and cout. If you do not know how to use cin and cout, please review it before proceeding. ifstream is for an input file connection and an ofstream is for an output file connection. Once set up, they can be used the same as cin and cout respectively. Both ifstream and ofstream are C++ classes and so you need to create an instance of each class in order to use it. You have been using classes throughout your coding work with C++. The one that is easiest to explain is the class “string”. String is a class and the name of your string is the instance of the class. In your header section, it would described as:

string myString = "This is a string."

later in the code, you might want to find its length.

int len = myString.length();           // This finds the length of the string store in your instance of string.

To be fair, there are five different ways to find the length of a string. The first four are more useful than the fifth.

length() is considered a method of the class string and can be called by adding it to the instance of the class string by adding a “.” and then the name of the method to the instance name, as seen in the example above.

Now getting back to ifstream and ofstream.  First create the instance of each class to use.

ofstream outFile;       // define the interface to the file for writing information.
ifstream inFile;        // define the interface to the file for reading information.

The next thing to do is to open the file and seek the start of the file, again done by two methods:;

Now to read something from the file one line at a time until no more lines are left in the file and divide up the line into phrases that are separated by commas:

for (string line; getline(inFile, line); ) {   // Read a line, stopping at newline (\n), keep going until EOF (end of file).
       stringstream stream(line);                // Set up the line to be readable through a stream.
      index = 0;
      while (getline(stream, word[index], ',')) {
          cout << headers[index] << word[index] << "\n";
      sum += stod(word[2]);

Output to a file is even simpler, First open the file. You have to see if the file exists. If it does, give the user the choice to write over the file or append to the file. If the file does not exist, create it.

if (isFileExist(fileName)) {
     // The file exists, so give the user the choice to start a new file or append to the existing file.
     int appendToFile = stoi(input("Do you want to:\n1) Open fresh file?\n2) Append to current file?\nChose"));
     switch (appendToFile)
        case 1:
 ;     // Open an existing file, overwriting current content..
 , fstream::app); // Open an existing file and allow appending new data.
else, fstream::out);  // Force the creation of the file and then open.

Once you have opened/created the file you can write to it just like you do to the console through cout.

 outFile << employee << "," << birthdate << "," << wages << endl;

The above code will write a comma separated list with three fields to one line in the file. Be sure to close the files when you are done.

Posted in Uncategorized | Leave a comment