Questions
A simple c program is needed to create encrypt and decode social security numbers. Then a...

A simple c program is needed to create encrypt and decode social security numbers. Then a validation must be used to make sure there are no invalid numbers.

**********************************************C PROGRAMMING*********************************************************************************

char social[][12] = {"164-55-0726","948-44-1038","193-74-0274","458-57-2867","093-00-1093","159-56-9731","695-21-2340","753-66-
6482","852-73-4196","648-81-1456","879-61-1829","123-87-0000","000-65-3197","741-85-9632","963-25-7418"};

Create a function that will accept as input a properly formatted social security number.
Then increment each digit by one. If the digit is "9" then make it a "0". Return a properly formatted
social security number.
Then create a function that will do the opposite. This function will take an encoded social security
number and convert it back into an unencrypted social security number. The de-encoded number is
what this function will return.

Create a function to scan all of the patient's social security numbers and detect if any of them are
invalid.
A Social Security Number (SSN) consists of nine digits, commonly written as three fields separated by
hyphens: AAA-GG-SSSS. The first three-digit field is called the "area number". The central, two-digit field
is called the "group number". The final, four-digit field is called the "serial number". Any SSN conforming
to one of the following criteria is an invalid number:

Any field all zeroes (no field of zeroes is ever assigned).
First three digits above 740
If you detect an invalid social security number, print the patient's name, their social security number,
and then either "area number", "group number", or "serial number" to indicate where the problem with
the social security number was detected.

In: Computer Science

********************************************C PROGRAMMING************************************************************************************* char lname[][10]={"Johnson","Williams","Ling","Albin","Anderson","Baca","Birner","Dominguez","Aimino", "Armstron

********************************************C PROGRAMMING*************************************************************************************

char lname[][10]={"Johnson","Williams","Ling","Albin","Anderson","Baca","Birner","Dominguez","Aimino", "Armstrong","Beard","Calderon","Carter","Chaname","Chaney"};

char fname[][10] ={"Fred","Betty","Hector","Ross","Jason","Elisa","Dalton","Javier","Ann","Addison","Cindy","Yamil","Thomas","Bryan","Kris"};

char middle[] = {'N','L','X','L','O','L','M','B','S','T','J','C','P','D','Z'};

char city[][10] = {"Lakeland","Orlando","Tampa","Lakeland","Tampa","Lakeland","Orlando","Orlando", "Lakeland","Lakeland","Orlando","Tampa","Tampa","Lakeland","Orlando"};

Create a report that lists all of the cities that patients live in and provide a count for
each city of how many patients come from that city. Print this list out in alphabetical
order based on city name.

In: Computer Science

Complete each of the programs here. Create a separate Netbeans project for each program using the...

Complete each of the programs here. Create a separate Netbeans project for each program using the name I specified. Create a single java main class for each of the programs using the filename I specified.

Task 1: (5 points)
Project name: CtoFConverter
Main file name: TempConverter.java
A program that converts an inputted temperature in C and provides the equivalent temperature in F. Hint: Google is your friend! Given C, solve for F. Again, check for a valid input value and only respond with the F value if you got it, otherwise output an appropriate error msg to the user. Testing: 3 conditions: Bad Input, then test for the known freezing and boiling points.

EMBED SCREEN SHOT(S) OR COPY THE OUTPUT WINDOW OF NETBEANS HERE SHOWING YOUR PROGRAM TEST RUN(S):

Task 2: (5 points)
Project name: FuelCosts
Main file name: FuelCost.java
Write a program that asks the user to input
• The number of gallons of gas currently in the tank
• The fuel efficiency in miles per gallon
Then print how far the car can go with the gas in the tank. Again, check for valid input and exit with an error msg if you do not have it. Testing: here just use some reasonable values that you can inspect the calculations and determine they are correct.

In: Computer Science

home / study / engineering / computer science / computer science questions and answers / instructions...

home / study / engineering / computer science / computer science questions and answers / instructions write a program to convert the time from 24-hour notation to 12-hour notation ...

Question: Instructions Write a program to convert the time from 24-hour notation to 12-hour notation and vi...

Instructions

Write a program to convert the time from 24-hour notation to 12-hour notation and vice versa. Your program must be menu driven, giving the user the choice of converting the time between the two notations.

Furthermore, your program must contain at least the following functions:

  • a function to convert the time from 24-hour notation to 12-hour notation;
  • a function to convert the time from 12-hour notation to 24-hour notation;
  • a function to display the choices;
  • function(s) to get the input;
  • and function(s) to display the results.
    (For 12-hour time notation, your program must display AM or PM.)
  • the language must be c++, also the out put format should be (The time is: hh:mm:ss

In: Computer Science

Discuss the negatives of Net Neutrality from the perspective of an ISP. Discuss the positives of...

Discuss the negatives of Net Neutrality from the perspective of an ISP.
Discuss the positives of Net Neutrality from the perspective of an e-commerce site.
Weigh both cases and discuss, from a societal perspective, which argument (for or against) you support and why.

Give more details.

In: Computer Science

In C++ Valid Palindrome In this assignment, you need to implement a bool isPalindrome(string s) function....

In C++ Valid Palindrome

In this assignment, you need to implement a bool isPalindrome(string s) function. Given a string s, isPalindrome(s) can determine if s is a palindrome, considering only alphanumeric characters and ignoring cases.

Note: for the purpose of this problem, we define empty string as valid palindrome.

Example 1: Input: ”A man, a plan, a canal: Panama” Output: true

Example 2: Input: ”race a car” Output: false

Requirement: There are many methods to check if a string is a palindrome or not. In this assignment, you need to use stack AND queue to in your implementation.

Suggestions: You don’t need to create the stack and queue classes by yourself. You can use the stack and queue implemention provided on Blackboard or use STL directly.

Consider all possible cases.

In: Computer Science

Create 6 tags with text inside them (in a valid HTML page,) color each differently. All...

  1. Create 6 tags with text inside them (in a valid HTML page,) color each differently. All show up on the page at this point... it's better to try to have everything upfront and in the open 1st and later have them hide, hover, or whatever interaction they will do. See the video for the text, don't bother matching the colors in the video.

  2. Validate the HTML. Bugs multiply as you make the page more complex; a CSS problem could actually be an HTML problem.

  3. Find the CSS property to HIDE something using CSS (there are two different ones that would work.) Hide all the tags by default. Knowing how to hide things with CSS is extremely useful (not just necessary for this assignment.)

  4. Using Media Queries show the proper tags depending upon the device changes:

    1. show landscape when the device is in landscape orientation

    2. show portrait when the device is in portrait orientation

    3. show >300 wide when the device is over 300px wide

    4. show >300 tall when the device is over 300px high

    5. show HD TV when the device the exact aspect ratio is 16/9 (there is a feature for aspect ratio; in firefox to preview you will need the exact window size for that ratio, you do not have to use HD you can use smaller numbers; equation: width = height*16/9. Also, you can look at the video)

    6. show big when the device is above in 400px width and height.

  5. Optional: instead of px pixel units, try using rem units. If you do, you should look up what a root em unit is so you know how big they are.

In: Computer Science

Consider sending a 2,000-byte datagram into a link with a MTU of 980 bytes. Suppose the...

Consider sending a 2,000-byte datagram into a link with a MTU of 980 bytes. Suppose the

original datagram has the identification number 227. How many fragments are generated? For

each fragment, what is its size, what is the value of its identification, fragment offset, and

fragment flag?

In: Computer Science

The Luxury Ocean Cruise Outings company has provided Global Rain with a software specification document that...

The Luxury Ocean Cruise Outings company has provided Global Rain with a software specification document that details a menu-driven software application. Other developers on your software development team have already begun this project by creating the Ship, Cruise, Passenger, and Driver classes. You will modify the classes by including attributes and their proper data structures, writing methods to perform required functionality and behavior, and making sure that your program performs input validation and exception handling.

--------DRIVER.JAVA---------

import java.util.ArrayList;
import java.util.Scanner;

import static java.lang.Integer.parseInt;

public class Driver {

// class variables (add more as needed)
private static ArrayList shipList = new ArrayList();
private static ArrayList cruiseList = new ArrayList();
private static ArrayList passengerList = new ArrayList();


public static void main(String[] args) {

initializeShipList(); // initial ships
initializeCruiseList(); // initial cruises
initializePassengerList(); // initial passengers

// add loop and code here that accepts and validates user input
// and takes the appropriate action. include appropriate
// user feedback and redisplay the menu as needed


}

// hardcoded ship data for testing
// Initialize ship list
public static void initializeShipList() {
add("Candy Cane", 20, 40, 10, 60, true);
add("Peppermint Stick", 10, 20, 5, 40, true);
add("Bon Bon", 12, 18, 2, 24, false);
add("Candy Corn", 12, 18, 2, 24, false);
}

// hardcoded cruise data for testing
// Initialize cruise list
public static void initializeCruiseList() {
Cruise newCruise = new Cruise("Southern Swirl", "Candy Cane", "Miami", "Cuba", "Miami");
cruiseList.add(newCruise);
}

// hardcoded cruise data for testing
// Initialize passenger list
public static void initializePassengerList() {
Passenger newPassenger1 = new Passenger("Neo Anderson", "Southern Swirl", "STE");
passengerList.add(newPassenger1);

Passenger newPassenger2 = new Passenger("Trinity", "Southern Swirl", "STE");
passengerList.add(newPassenger2);

Passenger newPassenger3 = new Passenger("Morpheus", "Southern Swirl", "BAL");
passengerList.add(newPassenger3);
}

// custom method to add ships to the shipList ArrayList
public static void add(String tName, int tBalcony, int tOceanView,
int tSuite, int tInterior, boolean tInService) {
Ship newShip = new Ship(tName, tBalcony, tOceanView, tSuite, tInterior, tInService);
shipList.add(newShip);
}


public static void printShipList(String listType) {
// printShipList() method prints list of ships from the
// shipList ArrayList. There are three different outputs
// based on the listType String parameter:
// name - prints a list of ship names only
// active - prints a list of ship names that are "in service"
// full - prints tabbed data on all ships

if (shipList.size() < 1) {
System.out.println("\nThere are no ships to print.");
return;
}
if (listType == "name") {
System.out.println("\n\nSHIP LIST - Name");
for (int i = 0; i < shipList.size(); i++) {
System.out.println(shipList.get(i));
}
} else if (listType == "active") {
System.out.println("\n\nSHIP LIST - Active");

// complete this code block
}

} else if (listType == "full") {
System.out.println("\n\nSHIP LIST - Full");
System.out.println("-----------------------------------------------");
System.out.println(" Number of Rooms In");
System.out.print("SHIP NAME Bal OV Ste Int Service");
System.out.println("\n-----------------------------------------------");
for (Ship eachShip: shipList)
eachShip.printShipData();

} else
System.out.println("\n\nError: List type not defined.");
}

public static void printCruiseList(String listType) {
if (cruiseList.size() < 1) {
System.out.println("\nThere are no cruises to print.");
return;
}
if (listType == "list") {
System.out.println("\n\nCRUISE LIST");
for (int i=0; i < cruiseList.size(); i++) {
System.out.println(cruiseList.get(i));
}
} else if (listType == "details") {
System.out.println("\n\nCRUISE LIST - Details");
System.out.println("------------------------------------------------------------------------------------------");
System.out.println(" |----------------------PORTS-----------------------|");
System.out.print("CRUISE NAME SHIP NAME DEPARTURE DESTINATION RETURN");
System.out.println("\n-----------------------------------------------------------------------------------------");
for (Cruise eachCruise: cruiseList)
eachCruise.printCruiseDetails();
} else
System.out.println("\n\nError: List type not defined.");
}

public static void printPassengerList() {
if (passengerList.size() < 1) {
System.out.println("\nThere are no passengers to print.");
return;
}
System.out.println("\n\nPASSENGER LIST");
System.out.println("-----------------------------------------------------");
System.out.print("PASSENGER NAME CRUISE ROOM TYPE");
System.out.println("\n-----------------------------------------------------");
for (Passenger eachPassenger: passengerList)
eachPassenger.printPassenger();
}

// display text-based menu
public static void displayMenu() {

System.out.println("\n\n");
System.out.println("\t\t\tLuxury Ocean Cruise Outings");
System.out.println("\t\t\t\t\tSystem Menu\n");
System.out.println("[1] Add Ship [A] Print Ship Names");
System.out.println("[2] Edit Ship [B] Print Ship In Service List");
System.out.println("[3] Add Cruise [C] Print Ship Full List");
System.out.println("[4] Edit Cruise [D] Print Cruise List");
System.out.println("[5] Add Passenger [E] Print Cruise Details");
System.out.println("[6] Edit Passenger [F] Print Passenger List");
System.out.println("[x] Exit System");
System.out.println("\nEnter a menu selection: ");
}

// Add a New Ship
public static void addShip() {

// complete this method

}

// Edit an existing ship
public static void editShip() {

// This method does not need to be completed
System.out.println("The \"Edit Ship\" feature is not yet implemented.");

}

// Add a New Cruise
public static void addCruise() {

// complete this method

  
}

// Edit an existing cruise
public static void editCruise() {

// This method does not need to be completed
System.out.println("The \"Edit Cruise\" feature is not yet implemented.");

}

// Add a New Passenger
public static void addPassenger() {

Scanner newPassengerInput = new Scanner(System.in);
System.out.println("Enter the new passenger's name: ");
String newPassengerName = newPassengerInput.nextLine();

// ensure new passenger name does not already exist
for (Passenger eachPassenger: passengerList) {
if (eachPassenger.getPassengerName().equalsIgnoreCase(newPassengerName)) {
System.out.println("That passenger is already in the system. Exiting to menu...");
return; // quits addPassenger() method processing
}
}

// get cruise name for passenger
System.out.println("Enter cruise name: ");
String newCruiseName = newPassengerInput.nextLine();

// ensure cruise exists
for (Cruise eachCruise: cruiseList) {
if (eachCruise.getCruiseName().equalsIgnoreCase(newCruiseName)) {
// cruise does exist
} else {
System.out.println("That cruise does not exist in the system. Exiting to menu...");
return; // quits addPassenger() method processing
}
}

// get room type
System.out.println("Enter Room Type (BAL, OV, STE, or INT: ");
String room = newPassengerInput.nextLine();
// validate room type
if ((room.equalsIgnoreCase("BAL")) || (room.equalsIgnoreCase("OV")) ||
(room.equalsIgnoreCase("STE")) || (room.equalsIgnoreCase("INT"))) {
// validation passed - add passenger
Passenger newPassenger = new Passenger(newPassengerName, newCruiseName, room.toUpperCase());
passengerList.add(newPassenger);
} else {
System.out.println("Invalid input. Exiting to menu...");
return; // quits addPassenger() method processing
}
}

// Edit an existing passenger
public static void editPassenger() {

// This method does not need to be completed
System.out.println("The \"Edit Passenger\" feature is not yet implemented.");

}

// Method to check if input is a number
public static boolean isANumber(String str) {
for (int i = 0; i < str.length(); i++) {
if (Character.isDigit(str.charAt(i)) == false)
return false;
}
return true;
}

}

----PASSENGER.JAVA------

public class Passenger {

    // Class variables
    private String passengerName;
    private String passengerCruise;
    private String passengerRoomType;


    // Constructor - default
    Passenger() {
    }

    // Constructor - full
    Passenger(String pName, String pCruise, String pRoomType) {
        passengerName = pName;
        passengerCruise = pCruise;
        passengerRoomType = pRoomType; // should be BAL, OV, STE, or INT
    }

    // Accessors
    public String getPassengerName() {
        return passengerName;
    }

    public String getPassengerCruise() {
        return passengerCruise;
    }

    public String getPassengerRoomType() {
        return passengerRoomType;
    }

    // Mutators
    public void setPassengerName(String tVar) {
        passengerName = tVar;
    }

    public void setPassengerCruise(String tVar) {
        passengerCruise = tVar;
    }

    public void setPassengerRoomType(String tVar) {
        passengerRoomType = tVar;
    }

    // print method
    public void printPassenger() {
        int spaceCount;
        String spaces1 = "";
        String spaces2 = "";
        spaceCount = 20 - passengerName.length();
        for (int i = 1; i <= spaceCount; i++) {
            spaces1 = spaces1 + " ";
        }
        spaceCount = 20 - passengerCruise.length();
        for (int i = 1; i <= spaceCount; i++) {
            spaces2 = spaces2 + " ";
        }

        System.out.println(passengerName + spaces1 + passengerCruise + spaces2 +
                passengerRoomType);
    }

    // method added to print passenger's name vice memory address
    @Override
    public String toString() {
        return passengerName;
    }

}

In: Computer Science

•Write a Write a Python script that performs brute force to extract a password protected zip...

•Write a Write a Python script that performs brute force to extract a password protected zip file named sec3.zip. The password is believed to be associated with one of the dictionary words in the 'wordlist.txt file. The password policy enforces that all employees MUST use passwords that include at least one capital and one digit. The files are attached (hint must import zipfile)

In: Computer Science

Write this code in python Debugging: Use the Debugging Coin Toss code below as the basis...

Write this code in python Debugging:

Use the Debugging Coin Toss code below as the basis for this project. Get the program running exactly as it appears in the text. It will run as written. Although it runs, does it run (behave) correctly? That is where you will focus your debugging efforts.

Code:

import random

guess = ' '

while guess not in ('heads', 'tails'):

     print('Guess the coin toss! Enter heads or tails: ')

     guess = input()

toss = random.randint(0, 1) # 0 is tails, 1 is heads

if toss == guess:

    print('You got it!')

else:

    print('Nope! Guess again!')

    guess = input()

    if toss == guess:

        print('You got it!')

   else:

        print('Nope. You are really bad at this game.')

Tasks Your program is to accomplish the following:

1. Welcome the user to the program

2. Keep the program flow of the original text. You will probably add to the original text, but totally rewriting the code is neither required nor desired.

3. Use debugging tools to identify if/where there is an issue with the program

4. Required: Enable logging and place logging messages in your source code. See text examples for purpose and placement of logging messages.

At a minimum, have start and end program logging messages and logging messages when variable values are changed/updated.

Write the log messages to a file ‘coin_toss_log.txt’. Log messages should not go to the screen.

5. Required: Use assertions in your source code. At a minimum, place two assertions in your code.

I recommend placing assertions to do ‘sanity’ checks on variable (guess and toss) values and types.

6. Required: Leave all your debugging code in your source code. If I don’t see it, you didn’t do it.  

7. Recommended. Run your coin_toss program with IDLE’s debugger enabled. Watch the variables closely; value and type.

8. Optional. Use other tools addressed in our text. Experiment, explore, play.  

Notes - Study the code and determine what debugging tools you can use, and where to use them, to help you determine if this program is running correctly, and if not, how to correct it. - Work on your screen output. Put effort towards an attractive output that a user/gamer would find appealing. -

In: Computer Science

•From the e-Activity, determine the type of cache memory (i.e., Level 1, Level 2, or another...

•From the e-Activity, determine the type of cache memory (i.e., Level 1, Level 2, or another type) that resides on a computer that you own or on a computer that you would consider purchasing. Examine the primary manner in which the type of cache memory that you have identified interfaces with the CPU and memory on your computer. Determine which type of cache memory is the most efficient, and provide one (1) example that depicts the manner in which the use of one (1) type of cache memory makes your computer processing more efficient than another. •Evaluate the advantages and disadvantages of both symmetrical and master-slave multiprocessing systems in regards to computer processing speed, multiprocessing configuration, overheating, and cost. Of the two (2), recommend the type of processor that would be better suited for a computer that is primarily used for the following: Word processing, Microsoft Excel spreadsheets, and computer gaming. Provide a rationale for your response.

In: Computer Science

1) Describe the issues regarding Net Neutrality. 2) Discuss the negatives from the perspective of an...

1) Describe the issues regarding Net Neutrality.

2) Discuss the negatives from the perspective of an ISP.
Give more details. Thank you.

In: Computer Science

using c language: create an array of the values of a sine wave. Include the math.h...

using c language:

create an array of the values of a sine wave. Include the math.h header to use the sin floating point function. The function sin takes an argument of radians (not degrees). Make your array721 elements and initialize each element with 10 * sin(2*3.1416* (i/360.0) where i is the array index from 0 - 720. When done properly, the array should contain approximately 2 complete sine wave cycles. Similarly, create an array of 721 elements only this time initialize it with a cosine function with amplitude 5 Have the program process and compute the following (in the order given); display the title of the action and answers on the screen: The maximum value of the cos and sin array added together. The mean value of the sin array The mean value of the element by element product of the sin and cos. The median value of the cos array. The dot product of the cos and sin array. The dot product of a reversed cos array with a sin array.

In: Computer Science

Access and review the brief article on "Why Networking is Important in Your Everyday Life" by...

Access and review the brief article on "Why Networking is Important in Your Everyday Life" by Tatiana Maldonado on the Network After Work blog.

In what ways do computer networks impact your everyday life? Share at least one area, not included in Ms. Madonado's article, in which networks are a part of or have an effect on your life.

In: Computer Science