IT217 Week 8

question 1

 JustBasic allows you to use file from your computer to load into your program.  Use some specific examples to explain the advantages of importing files from your computer into your program. 

question 2

Modify the Tic-tac-toe program Below

1. Modify the Tic-tac-toe program to add two little windows on each side of the “Start Game” button: On the left, first window will say “Player X Turn” only when Player X needs to play and second window will say “Wins” to keep count of payer X wins. On the right-hand side of the “Start Game” button, do the same for “Player O”.

 ‘ *************************************************************************

‘ Script Name: TicTacToe.bas (The Tic Tac Toe Game)

‘ Version:     1.0

‘ Author:      Jerry Lee Ford, Jr.

‘ Date:        March 1, 2007

‘ Description: This game is a Just BASIC implementation of the classic

‘              children’s Tic Tac Toe game. This game pits two players

‘              against one another to see who can line up three

‘              consecutive characters in a row.

‘ *************************************************************************

nomainwin   ‘Suppress the display of the default text window

‘Assign default values to global variables

global currentPlayer$, noMoves

global a1$, a2$, a3$, b1$, b2$, b3$, c1$, c2$, c3$

currentPlayer$ = “X”  ‘Player X always starts off each game

call ManageGamePlay ‘Call the subroutine responsible for managing game play

wait  ‘Pause the application and wait for the player’s instruction

‘This subroutine displays the game board and controls interaction with the

‘player

sub ManageGamePlay

  WindowWidth = 400   ‘Set the width of the window to 500 pixels

  WindowHeight = 500  ‘Set the height of the window to 500 pixels

  loadbmp “_”, “C:images_.bmp”   ‘Load the specified bitmap

                                   ‘file into memory

  loadbmp “O”, “C:imageso.bmp”   ‘Load the specified bitmap

                                   ‘file into memory

  loadbmp “X”, “C:imagesx.bmp”  ‘Load the specified bitmap

                                   ‘file into memory

  ‘Define the format of statictext controls displayed on the window

  statictext #play.statictext1, “T I C   T A C   T O E”, 45, 20, 440, 30

  statictext #play.statictext2, “Copyright 2007”, 265, 55, 80, 20

  ‘Add nine bmpbutton controls representing the game board to the window

  ‘First column

  bmpbutton #play.a1, “C:images_.bmp”, ProcessMove, UL, 45, 90

  bmpbutton #play.a2, “C:images_.bmp”, ProcessMove, UL, 150, 90

  bmpbutton #play.a3, “C:images_.bmp”, ProcessMove, UL, 255, 90

  ‘Second column

  bmpbutton #play.b1, “C:images_.bmp”, ProcessMove, UL, 45, 194

  bmpbutton #play.b2, “C:images_.bmp”, ProcessMove, UL, 150, 194

  bmpbutton #play.b3, “C:images_.bmp”, ProcessMove, UL, 255, 194

  ‘Third column

  bmpbutton #play.c1, “C:images_.bmp”, ProcessMove, UL, 45, 298

  bmpbutton #play.c2, “C:images_.bmp”, ProcessMove, UL, 150, 298

  bmpbutton #play.c3, “C:images_.bmp”, ProcessMove, UL, 255, 298

  ‘Add the game’s button control to the window

  button #play.button1 “Start New Game”, ResetGameBoard, UL, _

    147, 420, 100, 30

  ‘Open the window with no frame and a handle of #play

  open “Tic Tac Toe” for window_nf as #play

  ‘Set up the trapclose event for the window

  print #play, “trapclose ClosePlay”

  ‘Set the font type, size and attributes

  print #play.statictext1, “!font Arial 24 bold”

  print #play.button1, “!setfocus”;  ‘Set focus to the button control

  ‘Pause the application and wait for the player’s instruction

  wait

end sub

‘This subroutine processes player moves, deciding when moves are

‘valid and invalid and assigning game board squares accordingly

sub ProcessMove handle$

  ‘Set up a select case code block to process player moves

  select case handle$

    case “#play.a1”  ‘The player selects the 1st square on the 1st row

      if a1$ = “” then  ‘Let the player have the square if its available

        a1$ = currentPlayer$  ‘Assign the square to the current player

        print #play.a1, “bitmap ” + currentPlayer$  ‘Display bitmap image

      else

        notice “Sorry, but this square is already assigned. Try again!”

        exit sub  ‘There is no need to keep going so exit the subroutine

      end if

    case “#play.a2”  ‘The player selects the 2nd square on the 1st row

      if a2$ = “” then  ‘Let the player have the square if its available

        a2$ = currentPlayer$  ‘Assign the square to the current player

        print #play.a2, “bitmap ” + currentPlayer$  ‘Display bitmap image

      else

        notice “Sorry, but this square is already assigned. Try again!”

        exit sub  ‘There is no need to keep going so exit the subroutine

      end if

    case “#play.a3”  ‘The player selects the 3rd square on the 1st row

      if a3$ = “” then  ‘Let the player have the square if its available

        a3$ = currentPlayer$  ‘Assign the square to the current player

        print #play.a3, “bitmap ” + currentPlayer$  ‘Display bitmap image

      else

        notice “Sorry, but this square is already assigned. Try again!”

        exit sub  ‘There is no need to keep going so exit the subroutine

      end if

    case “#play.b1”  ‘The player selects the 1st square on the 2nd row

      if b1$ = “” then  ‘Let the player have the square if its available

        b1$ = currentPlayer$  ‘Assign the square to the current player

        print #play.b1, “bitmap ” + currentPlayer$  ‘Display bitmap image

      else

        notice “Sorry, but this square is already assigned. Try again!”

        exit sub  ‘There is no need to keep going so exit the subroutine

      end if

    case “#play.b2”  ‘The player selects the 2nd square on the 2nd row

      if b2$ = “” then  ‘Let the player have the square if its available

        b2$ = currentPlayer$  ‘Assign the square to the current player

        print #play.b2, “bitmap ” + currentPlayer$  ‘Display bitmap image

      else

        notice “Sorry, but this square is already assigned. Try again!”

        exit sub  ‘There is no need to keep going so exit the subroutine

      end if

    case “#play.b3”  ‘The player selects the 3rd square on the 2nd row

      if b3$ = “” then  ‘Let the player have the square if its available

        b3$ = currentPlayer$  ‘Assign the square to the current player

        print #play.b3, “bitmap ” + currentPlayer$  ‘Display bitmap image

      else

        notice “Sorry, but this square is already assigned. Try again!”

        exit sub  ‘There is no need to keep going so exit the subroutine

      end if

    case “#play.c1”  ‘The player selects the 1st square on the 3rd row

      if c1$ = “” then  ‘Let the player have the square if its available

        c1$ = currentPlayer$  ‘Assign the square to the current player

        print #play.c1, “bitmap ” + currentPlayer$  ‘Display bitmap image

      else

        notice “Sorry, but this square is already assigned. Try again!”

        exit sub  ‘There is no need to keep going so exit the subroutine

      end if

    case “#play.c2”  ‘The player selects the 2nd square on the 3rd row

      if c2$ = “” then  ‘Let the player have the square if its available

        c2$ = currentPlayer$  ‘Assign the square to the current player

        print #play.c2, “bitmap ” + currentPlayer$  ‘Display bitmap image

      else

        notice “Sorry, but this square is already assigned. Try again!”

        exit sub  ‘There is no need to keep going so exit the subroutine

      end if

    case “#play.c3”  ‘The player selects the 3rd square on the 3rd row

      if c3$ = “” then  ‘Let the player have the square if its available

        c3$ = currentPlayer$  ‘Assign the square to the current player

        print #play.c3, “bitmap ” + currentPlayer$  ‘Display bitmap image

      else

        notice “Sorry, but this square is already assigned. Try again!”

        exit sub  ‘There is no need to keep going so exit the subroutine

      end if

  end select

  noMoves = noMoves + 1  ‘Increment the variable representing the number of

                         ‘moves made so far in this game

  ‘Call the subroutine responsible for determining when the game is over

  call LookForEndOfGame

  ‘Call the subroutine responsible for controlling whose turn it is

  call SwitchPlayerTurn

end sub

‘This subroutine is responsible for switching between Player X and

‘Player O’s turns

sub SwitchPlayerTurn

  ‘If Player X just went then it is Player O’s turn

  if currentPlayer$ = “X” then

    currentPlayer$ = “O”  ‘Make Player O the current player

    exit sub  ‘There is no need to keep going so exit the subroutine

  end if

  ‘If Player O just went then it is Player X’s turn

  if currentPlayer$ = “O” then

    currentPlayer$ = “X”  ‘Make Player X the current player

    exit sub  ‘There is no need to keep going so exit the subroutine

  end if

end sub

‘This subroutine is called at the end of each player’s turn and is

‘responsible for determining if the game is over

sub LookForEndOfGame

  ‘Look horizontally for a winner

  ‘Check the first column

  if (a1$ = currentPlayer$) and (a2$ = currentPlayer$) and _

    (a3$ = currentPlayer$) then

    notice “Player ” + currentPlayer$ + ” has won!”

    exit sub  ‘There is no need to keep going so exit the subroutine

  end if

  ‘Check the second column

  if (b1$ = currentPlayer$) and (b2$ = currentPlayer$) and _

    (b3$ = currentPlayer$) then

    notice “Player ” + currentPlayer$ + ” has won!”

    exit sub  ‘There is no need to keep going so exit the subroutine

  end if

  ‘Check the third column

  if (c1$ = currentPlayer$) and (c2$ = currentPlayer$) and _

    (c3$ = currentPlayer$) then

    notice “Player ” + currentPlayer$ + ” has won!”

    exit sub  ‘There is no need to keep going so exit the subroutine

  end if

  ‘Look vertically for a winner

  ‘Check the first row

  if (a1$ = currentPlayer$) and (b1$ = currentPlayer$) and _

    (c1$ = currentPlayer$) then

    notice “Player ” + currentPlayer$ + ” has won!”

    exit sub  ‘There is no need to keep going so exit the subroutine

  end if

  ‘Check the second row

  if (a2$ = currentPlayer$) and (b2$ = currentPlayer$) and _

    (c2$ = currentPlayer$) then

    notice “Player ” + currentPlayer$ + ” has won!”

    exit sub  ‘There is no need to keep going so exit the subroutine

  end if

  ‘Check the third row

  if (a3$ = currentPlayer$) and (b3$ = currentPlayer$) and _

    (c3$ = currentPlayer$) then

    notice “Player ” + currentPlayer$ + ” has won!”

    exit sub  ‘There is no need to keep going so exit the subroutine

  end if

  ‘Look diagonally for a winner

  ‘Check from the top-left corner down to the lower-right corner

  if (a1$ = currentPlayer$) and (b2$ = currentPlayer$) and _

    (c3$ = currentPlayer$) then

    notice “Player ” + currentPlayer$ + ” has won!”

    exit sub  ‘There is no need to keep going so exit the subroutine

  end if

  ‘Check from the top-right corner down to the lower-left corner

  if (a3$ = currentPlayer$) and (b2$ = currentPlayer$) and _

    (c1$ = currentPlayer$) then

    notice “Player ” + currentPlayer$ + ” has won!”

    exit sub  ‘There is no need to keep going so exit the subroutine

  end if

  ‘If neither player has won and all squares have been chosen the game

  ‘ends in a tie

  if noMoves = 9 then

    notice “Tie. There was no winner this time!”

  end if

end sub

‘This subroutine resets the game board and global variables in order to

‘ready the game for a new round of play

sub ResetGameBoard handle$

  ‘Display a blank bitmap image in each game board square

  print #play.a1, “bitmap _”

  print #play.a2, “bitmap _”

  print #play.a3, “bitmap _”

  print #play.b1, “bitmap _”

  print #play.b2, “bitmap _”

  print #play.b3, “bitmap _”

  print #play.c1, “bitmap _”

  print #play.c2, “bitmap _”

  print #play.c3, “bitmap _”

  ‘Clear out any game board square assignments

  a1$ = “”

  a2$ = “”

  a3$ = “”

  b1$ = “”

  b2$ = “”

  b3$ = “”

  c1$ = “”

  c2$ = “”

  c3$ = “”

  noMoves = 0  ‘Reset the variable used to keep track of the total number

               ‘of moves made per game to zero

  currentPlayer$ = “X”  ‘Set Player X as the current player

end sub

‘This subroutine is called when the player closes the #play window

‘and is responsible for ending the game

sub ClosePlay handle$

  ‘Get confirmation before terminating program execution

  confirm “Are you sure you want quit?”; answer$

  if answer$ = “yes” then  ‘The player clicked on Yes

    close #play  ‘Close the #play window

    end  ‘Terminate the game

  end if

end sub

Data science

Textbook: Introduction to Data Mining

Select one key concept until Chapter 5 from the textbook and answer the following: 

  1. Define the concept.
  2. Note its importance to data science.
  3. Discuss corresponding concepts that are of importance to the selected concept.
  4. Note a project where this concept would be used.

Please include introduction and conclusion. The paper should be between 2-3 pages and formatted using APA 7 format. Two peer reviewed sources should be utilized to connect your thoughts to current published works.

What is the output

  

1 ) What is the output for the following:

for (int x = 1; x <= 7; x++)

cout << “GooDByen”;

2 ) What is the output for the following:

for (int x = 1; x <= 7; x++)

cout << “GooDBye”;

3 ) What is the output for the following:

for (int x = 1; x <= 3; x++)

{

for (int y =1; y <= 4; y++) 

cout << (( x+y)*2)<

}

4 ) This is an example of using pointers in code 

What is the output for the following:

char x[ ] = {“Have a Nice DAY”};

char *ptr;

ptr = x; OR ptr=&x[0];

while (*ptr != ‘n’)

{

if (*ptr = = ‘a’

cout << “You Have a Hitn”;

ptr++;

}

5 ) This is an example of using pointers in code 

What is the output for the following:

int p [ 5 ]= {100,200,300,400,500},*q,x;

q = p[ 4 ];

*q = 250;

p [ 1 ] = *q + 50;

q = p [2 ];

q++;

*q = *(q-1) +50;

q=&p[0];

for (int x = 4; x >= 0; x–)

cout << *(q + x)<

6 ) This is an example of using pointers in code, HOW WOULD YOU CHANGE THE CODE? 

Change Array notation (use of index) to pointer notation:

a) int x;

int arrays [ 5 ]= {100,200,300,400,500};

for (int x = 0; x < 5; x++)

cout << arrays [ x ]<< ‘ ‘;

#include

void swap(float&, float&); // function receives 2 references

int main()

{

float firstnum = 20.5, secnum = 6.25;

cout << "The value stored in firstnum is: " << firstnum << endl;

cout << "The value stored in secnum is: "<< secnum << "nn";

swap(firstnum, secnum); // call the function with references

cout << "The value stored in firstnum is now: "

<< firstnum << endl;

cout << "The value stored in secnum is now: "

<< secnum << endl;

return 0;

}

void swap(float &num1, float &num2)

{

float temp;

temp = num1; // save num1’s value

num1 = num2; // store num2’s value in num1

num2 = temp; // change num2’s value

return;

}

STACK QUEUE REVIEW

Use the Stack and Queue class declaration/implementation as in Programs 15.1 and 15.3 of Bronson or your text. Show what is written/output by the following segments of code.

Show what is written/output by the following segments of code.

Show what is written/output by the following segments of code.

Show what is written/output by the following segments of code.

Recursion Review

cin>> : is input from the key board. 

Problem1: Look at the following program, the input will be 19, 23, 55, 88, m one at a time.

Output:

What is the output?

What is the Base Case?

What is the recursive Case?

Using the LINKED LIST do the following:

// This program demonstrates the LINKED LIST member methods/functions

// append; adds a element

// This is a SORTED linked list, insert; puts the element in the location to keep order in // the sort 

// delete; removes the element stated.

Case Study

  

Introduction

X Axis is a renowned private cancer hospital located in Las Vegas. The hospital maintains a critical database that includes patient data for all patients. You are asked to create a BIA based on this database. If this database was inaccessible for six or more hours, what would be the impact?

Discussion Points:

1. Determine what type of risk-based impacts X Axis would encounter in such a situation. 

2. What are the potential business impacts in the emergency room (ER)?

3. What are the potential business impacts in the doctor offices?

4. What are the potential business impacts in other hospital locations such as patient rooms, or surgical wards?

5. Identify any other issues that might be impacted with the loss of the most prominent database?

IT Python

 

This is the flower box and it should at the beginning of each assignment
# You must add comments to your code
# Program name : Wk3_firstname_lastname.py
# Student Name : Ymmas Azaba
# Course : ENTD220
# Instructor : My Instructor
# Date : Any Day

# Description : This code will …..

# Copy Wrong : This is my work

You are going to enhance the prior assignment by doing the following:-

1) Create a function for each math operation (add, div, mult, sub)
2) The application will run forever, you will ask the user to continue or not.3) create a function IsinRange() to test a value between two ranges like this;Here is the spec in pseudo codeIsInRanhe(lr, hr, n) lr=low rangehr=high rangen=numberif n between ln and hnreturn trueelsereturn false

Hints 1) For practice please see lab exercises in the lesson section
2) See Sample output for messagesSample output

Enter your Lower range —> 10
Enter your Higher range —> 20
Enter your First number —> 15
Enter your Second number —> 17

The Result of 15.0+17.0=32.0
The Result of 15.0-17.0=-2.0
The Result of 15.0*17.0=255.0
The Result of 15.0/17.0=0.882352941176

Continue Looping Y/N Y

Enter your Lower range —> 20
Enter your Higher range —> 30
Enter your First number —> 25
Enter your Second number —> 50

  • The input values are out side the input ranges
  • Please check the numbers and try again
  • Thanks for using our calculator

Week 6 Python

 You are going to enhance the prior assignment by doing the following1) Use list to create a menu2) Create a function the will return the results of the four operations in a dictionary allInOne(n1,n2)Sample output

1) Add two numbers

2) Mult two number

3) Divide

4) Scalc

5) all in one ..

6) …

res=allInOne(5,2)

The results will be return in this format;

res is dictionary {“add”:7, “sub”:3, “mult”:10, “div”:2.5)

from res, you are going to print

5 + 2 = 7

5 – 2 = 3

5 * 2 = 10

5 / 2 = 2.5

Discussion

 

Discuss in 500 words or more the differences between and advantages of MAC, DAC, and RBAC.

Use at least three sources. Include at least 3 quotes from your sources enclosed in quotation marks and cited in-line by reference to your reference list.  Example: “words you copied” (citation) These quotes should be one full sentence not altered or paraphrased. Cite your sources using APA format. Use the quotes in your paragaphs.

Copying without attribution or the use of spinbot or other word substitution software will result in a grade of 0. 

Write in essay format not in bulleted, numbered or other list format. 

Do not use attachments as a submission. 

Mobile Applications Design, Difficulty and Considerations

Think about the last time you utilized a mobile application or attempted to build your own mobile website.  What planning process did you go through before you began your project?  You may have considered the steps or tasks you needed to perform.  You may also have considered the resources and platforms needed for your outcome.  For example, which model fits your business domain needs?  Do you have time constraints that will make completing the web application/site difficult within a reasonable period of time?  You may also have considered the myths that surround developing mobile apps and the difficulties generally associated with mobile app development.

1. Why is mobile development difficult?  Explain

2. How does design & utility make a difference between good vs great websites?

3. How is deciding between a mobile application vs a mobile website an important consideration by developers? Explain.

Instructions:

> 500 Words At least.

> You must apply and use the basic citation styles of APA.

> Do not claim credit for the words, ideas, and concepts of others.

> Use in-text citation and list the reference of your supporting source following APA’s style and formatting

> Do not copy and paste information or concepts from the Internet and claim that is your work.  It will be considered Plagiarism and you will receive a zero for your work.

ITS632- WK1

Assignment 1

Using the research databases available in the library, find two different scholarly papers involving data mining. The articles should be papers that were recently published (let’s say within the last five years). 

Discuss the significance of data mining as presented by the authors. Be sure to present the information in your own words and include citations to the articles. 

Requirement: 

· ****Separate word document for each assignment****

· Minimum 300-350 words. Cover sheet, abstract, graphs, and references do not count.

· Add reference separately for each assignment question.

· Strictly follow APA style. Length – 2 to 3 paragraphs. 

· Sources: 2 References to Support your answer

· No plagiarized content please! Attach a plagiarized report.

· Check for spelling and grammar mistakes!

· $5 max. Please bid if you agree.

assign

 

Assignment Instructions and Requirements

There are three parts of this assignment: development of a process,  writing a job description, and formulating interview questions. Each  must be presented in a separate Word document, with formatting and  document names that would be appropriate for the workplace.

Do not format your documents to look anything like APA papers.

  • Paragraphs should be single-spaced with a blank line between paragraphs.
  • Lists should be single-spaced.
  • Do not include a running head or other APA style elements.
  • It is acceptable but not required to have a cover page for your  documents. If you choose to do this, use the same cover for all three  documents for consistency sake (as you would in the workplace for  branding purposes).

Formality, neatness, and readability are expected.

Scenario:

You are the top IT manager for 504 Technologies and realize the need  for hiring a new tech employee. The company has not yet set up a hiring  process and the CEO has tasked you with creating one before writing the  job description and planning for interviews.

Document 1: Develop a hiring process.

  • Content: 
    • Write a suitable descriptive title in the document.
    • Include at least six distinct steps. 
      • Provide enough detail so that someone else would be able to easily  understand and follow all steps and sub-steps of this process.
      • You may write this entirely from your own experiences and critical  thinking. However, if you decide to use any source material, do not  quote or copy, and make sure you cite/reference using APA standards.
    • Include your first and last names at the very end of the document to identify yourself as the author.
  • Format: 
    • Write in complete sentences, and present your process in a numbered list form.
    • Format the document so that it looks professional and is highly readable.
  • Length: 
    • This document must contain 200–250 words. Should you find this difficult to attain, include your reasoning for the steps.
  • Document name: 
    • Use a logical, descriptive name for your Word document. Do not include the course number, unit number, or your name.

Document 2: Write a job description.

  • Preparation: Choose a career from the following list. If you wish to  investigate an IT career not on this list, you must receive prior  permission from the professor (ask via email). Note that the professor  reserves the right to deny requests, and if this occurs, will give you a  reason. 
    • Computer Programmer
    • Cybersecurity Specialist
    • Database Administrator
    • Graphics/Multimedia Designer
    • Information Security Analyst
    • IT Project Manager
    • Network Administrator
    • Tech Support / Help Desk
    • Webmaster
  • Content: 
    • Write a suitable descriptive title in the document.
    • Provide content as explained in the Reading PDF. 
      • Invent information about the company (do not copy from the course).
      • This person will work at the Springfield campus.
      • Do not include a salary or a salary range.
      • While reviewing job descriptions online may be helpful, do not copy,  quote, or cite sources. This description must be written from your  understanding of the job itself.
    • Include your first and last names at the very end of the document to identify yourself as the author.
  • Format: 
    • This will be a combination of a few paragraphs and several lists. Review the Reading PDF for this information.
    • Format the document so that it looks professional and is highly readable.
  • Length: 
    • This document must contain 200–250 words.
  • Document name: 
    • Use a logical, descriptive name for your Word document. Do not include the course number, unit number, or your name.

Document 3: Develop interview questions.

  • Content: 
    • Write a suitable descriptive title in the document.
    • Identify the job for which these questions are relevant. This must relate to the job description you wrote for Document 2.
    • Develop six (6) interview questions that the manager will ask candidates who are invited for interviews. 
      • Write meaningful questions that will help you focus on the  candidate’s qualifications and suitability for the job that you  advertised. Assume you already know the person’s name and that you will  not be asking simple questions that should be found in his/her resume.
      • Write open-ended questions (see the Reading PDF).
      • Do not ask illegal or unethical questions (see the Reading PDF).
      • Do not use source material for this document; it is okay to peruse  online ideas, but you must write this entirely in your own words and use  your critical thinking.
    • For each of your six questions, explain what you intend to learn  from the candidate’s answers. Examples are given in the Reading PDF.
    • Include your first and last names at the very end of the document to identify yourself as the author.
  • Format: 
    • Write in complete sentences, and present your questions in list  form. Reasoning should follow each question. You may use the bulleted  format shown in the Reading PDF examples.
    • Format the document so that it looks professional and is highly readable.
  • Length: 
    • There is no designated length except for ensuring that you have six complete questions accompanied by reasons for asking them.
  • Document name: 
    • Use a logical, descriptive name for your Word document. Do not include the course number, unit number, or your name.