Questions
how can i get the code for this problem in visual basic? Create a Windows Forms...

how can i get the code for this problem in visual basic? Create a Windows Forms applications called ISP (Internet Service Provider) Project. You must enter the number of hours for the month and select your desire ISP package. An ISP has three different subscription packages for it's customers:

Package A: For $9.95 per month 10 hours of access are provided. Additional hours are $2 per hours.
Package B: For $13.95 per month 20 hours of access are provided. Additional hours are $1 per hours.
Package C: For $19.95 per month unlimited access is provided.

The program should also calculates and display the amount of money Package A customers would save if they purchased Package B or C, and the amount of money Package B customers would save if they purchase Package C. If there would be no savings, no message should be displayed.
thank you

can the options be display without using a radio button for the choose

In: Computer Science

Program 3.5 - Conversion Program   - NOW using cin statements to gather input from user Concepts...

Program 3.5 - Conversion Program   - NOW using cin statements to gather input from user

Concepts Covered:  Chapter 2 – cout ,   math, data types, Chapter 3 , gathering both numeric & string input from user

Programs 2-21, 2-22, 2-23, 2-28 should help with math and programs 3.5, 3.17 and 3.19 should help you with the new concepts introduced with this program.

Program Purpose:  To help you understand the concept of using both proper numeric variables and string variables. To give you practice using the C++ math operators. To give you practice getting both numeric input and string input from a user. To give you practice overriding the default behavior of C++ for numeric formatting. Lastly, to appreciate the flexibility of the cout object by passing it string variables, string literals, and numeric variables.

Background:  Your instructor is an avid (some would say obsessed) bicyclist.  Rides of 40 to 50 miles are not uncommon. Your instructor also uses an indoor training program called Zwift. It uses the metric system which is kilometers biked (instead of miles), and meters climbed (instead of feet).     You need to help out your metrically challenged professor and write a conversion program that converts kilometers to miles and meters to feet.

For example, if I told some of my non-biking friends that I rode 40 kilometers, many of them would be impressed.  Well, in miles that is only 24.8 miles.   Conversely, if I told them I climbed 1000 meters they may not be impressed.  But, 1000 meters is 3,280 feet which is not too shabby here in the Midwest.

Oh, did I mention, this also applies to runners, especially in terms of kilometers.

  

So your job commission is to write a C++ program which will convert kilometers to miles and meters to feet.

PROGRAM SPECIFICATIONS:

Insert program heading with your name, course, section, program name, AS WELL AS brief documentation of program purpose at the top of your program.

Create your c++ code.

INPUT SECTION

Create 4 numeric variables to hold the following:  meters, feet, kilometers, and miles.

Create 2 string variables: one to hold the activity type:  biking or running and the other to hold a person’s name.

Prompt the user for their name. You should get the user's full name! Example   Jimmy C   or John Bonham

Prompt the user (using their name) for which activity they did. - biking or running

Prompt the user for how many kilometers

Prompt the user for how many meters they climbed

PROCESSING SECTION

Perform the necessary math operations to convert kilometers to miles and meters to feet.

Kilometers to miles formula:

1 kilometer is equal to 0.621371 miles (often shortened to .62). 1 mile is equal to 1.609344 kilometers. Thus, to convert kilometers to miles, simply multiply the number of kilometers by 0.62137.

Meters to feet formula:

Multiply any meter measurement by 3.28 to convert to feet. Since one meter = 3.28 feet, you can convert any meter measurement into feet by multiplying it by 3.28.

1 meter x 3.28 = 3.28 feet

5 meters x 3.28 = 16.4 feet

2.7 meters x 3.28 = 8.856 feet

OUTPUT SECTION

Using cout statements, display the output listing name, activity, kilometers, miles, meters and feet. For formatting of numeric variables, use 2 digits of precision to right of decimal point.with values shown above.

In: Computer Science

There are two calsses: node.py and a5.py. The a5.py contains three important methods: Length -> Outputs...

There are two calsses: node.py and a5.py. The a5.py contains three important methods:

  • Length -> Outputs the length of the linked list
  • Insert -> Inserts an element into the linked list
  • PrintStructure -> Prints the entire linked list starting from the head

The task is to fill in these methods given in the a5.py. Hints are given to you inside the a5.py class so make sure to check them out. Note that one of the important concepts in this example is that when a new element is inserted into the list, it gets inserted into it’s appropriate (sorted) position. Please take a look at the examples to see how random values are inputted and the result is sorted.

Please enter a word (or just hit enter to end): bottle

Please enter a word (or just hit enter to end): a

Please enter a word (or just hit enter to end): water Please enter a word (or just hit enter to end): of Please enter a word (or just hit enter to end):

The structure contains 4 items: a bottle of water

Please enter a word (or just hit enter to end): Ana

Please enter a word (or just hit enter to end): Bill

Please enter a word (or just hit enter to end): car

Please enter a word (or just hit enter to end): algorithm Please enter a word (or just hit enter to end): button Please enter a word (or just hit enter to end):

The structure contains 5 items: algorithm Ana Bill button car

NODE.PY

"""File: node.py

Node classes for one-way linked structures and two-way

linked structures."""

class Node(object):

def __init__(self, data, next = None):

"""Instantiates a Node with default next of None"""

self.data = data

self.next = next

A5.PY

"""
File: a5.py


Define a length function.
Define a printStructure function.
Define an insert function.
Test the above functions and the Node class.
"""

from node import Node

def length(head):
    """Returns the number of items in the linked structure
    referred to by head."""
    probe = head
    count = 0
   
    # ADD CODE HERE: Count the number of nodes in the structure
   
    return count
   
def insert(newItem, head):
    """Inserts newItem at the correct position (ascending order) in
    the linked structure referred to by head.
    Returns a reference to the new structure."""
    # if head == None:
        # if structure is empty
        # ADD CODE HERE       
    # else:
        #Insert newItem in its place (ascending order)
      # ADD CODE HERE
       
    return head

def printStructure(head):
    """Prints the items in the structure referred to by head."""
    # ADD CODE HERE

def main():
    """Gets words from the user and inserts in the
    structure referred to by head."""
   
    head = None
    userInput = input('Please enter a word (or just hit enter to end): ')
    while userInput != '':
        head = insert(userInput, head)
        userInput = input('Please enter a word (or just hit enter to end): ')
    print('The structure contains', length(head), 'items:')
    printStructure(head)

if __name__ == "__main__": main()

In: Computer Science

Imagine that you are a user in a hurry that types 2O (oh) rather than 20...

Imagine that you are a user in a hurry that types 2O (oh) rather than 20 (zero) as the height. What happens to your program? If the user enters a value that could not be converted to numeric type, allow 3 additional opportunities to enter a new value. If the user fails to enter a correct value after 4 attempts, inform them of such failure and allow the program to end without crashing.

Question: Can someone help me with this?

My original code:

# I put the area calculations of both the triangle and trapezoid up, so that the code could run through them both properly.
def triangle(height, base):
area_triangle = height * base * 0.5
print "the area of your triangle equals %s" % (area_triangle)
def trapezoid(height, base1, base2):
area_trapezoid = ((base1 + base2) / 2) * height
print "the area of your trapezoid equals %s" % (area_trapezoid)
# Giving the option to choose triangle or trapezoid area.
shapes = ["triangle", "trapezoid"]
# I gave my code a title and put my name on it.
print "Area calculator"
print "Made by Alison Voigt"
print "-------------------------------"
# Asking the user to enter either the triangle or the trapezoid to move on to the area calculation.
def calculation():
print "please type the name of your shape"
print "(triangle, trapezoid)"
# Once the user chooses a shape they are asked to enter in the height, and base(s) for the shape of their choosing.
user_shape = raw_input()
if user_shape == shapes[1]:
trapezoid(height = float(raw_input("please type the height of the trapezoid.")), base1 = float(raw_input("please type the base1 length of the trapezoid.")), base2 = float(raw_input("please type the base2 length of the trapezoid.")))
elif user_shape == shapes[0]:
triangle(height = float(raw_input("please type the height of the triangle.")), base = float(raw_input("please type the base length of the triangle.")))
# If the user enters in wrong answer the code will tell you to try again.
else:
print "That's not in the choices!, Try again."
calculation()
# The user is now given the option to calculate the same shape or the other.
calculation()
choice = raw_input("Would you like to calculate the area of a different shape?(yes/no)")
while choice == "yes":
print "---------------------"
calculation()

In: Computer Science

1. If I can assume "not P" and derive "not Q", I have completed an indirect...

1. If I can assume "not P" and derive "not Q", I have completed an indirect proof of the statement "P → Q".

T/F? Why?

2. If I want to prove "P → (x XOR NOT y)", it suffices to prove "P → (x AND y)".

T/F? Why?

3. Suppose I assume "A" and derive "B". Then I start over, assume "not B", and derive a contradiction. Then I may conclude that A is a tautology.

T/F? Why?

4. Suppose I first assume "A xor B" and prove "C".

Then I start over, assume "P", and prove "A and not B".

Finally I start again, assume "Q", and prove "not A and B".

Then I may conclude "(P or Q) → C".

T/F? Why?

5. Suppose I first assume A and derive B.

Then I start over, assume "not C", and derive "not B".

Then I start over, assume "C and not A", and derive "0".

I can now conclude that A, B, and C are all equivalent to one another.

T/F? Why?

In: Computer Science

Discussing - Network Security a) Discuss the relative merits of traditional signature-based IDS/IPS technology with newer...

Discussing - Network Security
a) Discuss the relative merits of traditional signature-based IDS/IPS technology with newer form, such as application awareness and anomaly detection.

b) Discuss and develop a theoretical network architecture for a small business in the area that wishes to expand into new facilities, like a colocation center in the downtown area.

In: Computer Science

Q. In java, I would like to know, especially how the program detect there is an...

Q. In java, I would like to know, especially how the program detect there is an error which is user should put only numerical data but if user put letter data (five, sixty instead of 5,60), *I want the program display "Invalid data. Please try again" instead of long error message(from the IDE)* when user put letter data(five, sixty stuff...) and GO BACK TO THE BEGINNING SO USER CAN PUT THE DATA AGAIN!

Write a program that counts change. The program should ask for the number of quarters, the number of dimes, the number of nickels and the number of pennies. The program should then compute the value of all the coins and tell the user how much money there is, expressed in dollars. Display a title at the top of the screen when the program first runs. You must use constants for the value of each coin type. Multiply the number of each coin times the value for each coin (the defined constant). Refer to the PowerPoint or video on the use of the constants.

1) if quarters =100 dimes = 100 nickels = 100 pennies = 99

=>expected result = 40.99

2) if quarters = hundred dimes = hundred nickels = nine pennies = hundred

=> expected result ""Invalid data. Please try again" (GO BACK TO THE BEGINNING, SO USER CAN PUT THE DATA AGAIN!) <- this is the part i am struggling. Please Help!

In: Computer Science

1. Circle: Implement a Java class with the name Circle. It should be in the package...

1. Circle:

Implement a Java class with the name Circle. It should be in the package edu.gcccd.csis.

The class has two private instance variables: radius (of the type double) and color (of the type String).

The class also has a private static variable: numOfCircles (of the type long) which at all times will keep track of the number of Circle objects that were instantiated.

Construction:

A constructor that constructs a circle with the given color and sets the radius to a default value of 1.0.

A constructor that constructs a circle with the given, radius and color.

Once constructed, the value of the radius must be immutable (cannot be allowed to be modified)

Behaviors:

Accessor and Mutator aka Getter and Setter for the color attribute

Accessor for the radius.

getArea() and getCircumference() methods, hat return the area and circumference of this Circle in double.

Hint: use Math.PI (https://docs.oracle.com/javase/8/docs/api/java/lang/Math.html#PI (Links to an external site.))

2. Rectangle:

Implement a Java class with the name Rectangle. It should be in the package edu.gcccd.csis.

The class has two private instance variables: width and height (of the type double)

The class also has a private static variable: numOfRectangles (of the type long) which at all times will keep track of the number of Rectangle objects that were instantiated.

Construction:

A constructor that constructs a Rectangle with the given width and height.

A default constructor.

Behaviors:

Accessor and Mutator aka Getter and Setter for both member variables.

getArea() and getCircumference() methods, that return the area and circumference of this Rectangle in double.

a boolean method isSquare(), that returns true is this Rectangle is a square.

Hint: read the first 10 pages of Chapter 5 in your text.

3. Container

Implement a Java class with the name Container. It should be in the package edu.gcccd.csis.

The class has two private instance variables: rectangle of type Rectangle and circle of type Circle.

Construction:

No explicit constructors.

Behaviors:

Accessor and Mutator aka Getter and Setter for both member variables.

an integer method size(), that returns 0, if all member variables are null, 1 either of the two member variables contains a value other than null, and 2, if both, the rectangle and circle contain values other than null.

In: Computer Science

Problem 1: More than 2500 years ago, mathematicians got interested in numbers. Armstrong Numbers: The number...

Problem 1:

More than 2500 years ago, mathematicians got interested in numbers.

Armstrong Numbers: The number 153 has the odd property that 13+53 + 33 = 1 + 125 + 27 = 153. Namely, 153 is equal to the sum of the cubes of its own digits.

Perfect Numbers: A number is said to be perfect if it is the sum of its own divisors (excluding itself). For example, 6 is perfect since 1, 2, and 3 divide evenly into 6 and 1+ 2 + 3 = 6.

Input File

The input is taken from a file named number.in and which a sequence of numbers, one per line, terminated by a line containing the number 0.

Output File

All the numbers read from the input file, are printed one per line followed by a sentence indicating whether the number is or is not Armstrong number and whether it is or is not a perfect number. Sample Input 153 6 0 Sample Output 153 is an Armstrong number but it is not a perfect number. 6 is not an Armstrong number but it is a perfect number.

Note: the program must be write in java

In: Computer Science

Identify the major steps involved in the data file update process

Identify the major steps involved in the data file update process

In: Computer Science

Using C++. Write a program to input marks of five subjects Physics, Chemistry, Biology, Mathematics and...

Using C++. Write a program to input marks of five subjects Physics, Chemistry, Biology, Mathematics and Computer. The input marks must be inserted one subject at a time. The program then calculate percentage and grade according to given conditions:

If percentage >= 90% : Grade A

If percentage >= 80% : Grade B

If percentage >= 70% : Grade C

If percentage >= 60% : Grade D

If percentage >= 40% : Grade E

If percentage < 40% : Grade F

Example1: Please input marks of five subjects.

Physics: 95

Chemistry: 95

Biology: 97

Mathematics: 98

Computer: 90

Percentage = 95.00

Grade A

Example2: Please input marks of five subjects.

Physics: 85

Chemistry: 80

Biology: 95

Mathematics: 98

Computer: 70

Percentage = 85.60

Grade B

In: Computer Science

You are to create a page that has four images that are links to other schools...

You are to create a page that has four images that are links to other schools in the New England area. Each image is to be controlled in size by a CSS responsive design. The page is to appear balanced by an appropriate, complimentary, background color. White is not an option as a background color. Look up how to make image links on W3Schools.There is to be a small repeated background image that appears on the right side of the page but not at the edge of the page. There is to be a header banner in a header section (look up "header" tag on W3Schools).The link images are to run vertically down the screen but they may not cover any part of the background image or the header banner.All images are to be in good taste and should represent the site to which they connect. The image does not have to be an exact image of that school but it has to be related.You can't use a fish image to represent a University.

Add an ordered list to your page that will list the current standings of the top eight teams in the National Football League. The list must be styled with CSS and can not use any of the default colors, fonts, or sizes. The first letter of each team's name must be a different color.No content may be against any of the screen edges.Make sure that your submission includes all folders required in your site structure.

In: Computer Science

Arrange the following binary tree types in increasing order of height with the worst-case height of...

Arrange the following binary tree types in increasing order of height with the worst-case height of each type.

Binary Tree

Full Binary Tree

Complete Binary Tree

Binary Search Tree

Balanced Binary Tree

In: Computer Science

Create a dynamic array-based Queue ADT class in C++ that contains enqueue(Inserts newElement at the back...

Create a dynamic array-based Queue ADT class in C++ that contains enqueue(Inserts newElement at the back ) and dequeue(Removes the frontmost element ). If the size of the array is equal to the capacity a new array of twice the capacity must be made.

The interface is shown:

class Queue {
    private:
        int* elements;  
        unsigned elementCount;  // number of elements in the queue
        unsigned capacity;      // number of cells in the array
        unsigned frontindex;    // index the topmost element
        unsigned backindex;     // index where the next element will be placed

    public:
        // Description: Constructor
        Queue();


        // Description: Inserts newElement at the back (O(1))
        void enqueue(int newElement);

 
        // Description: Removes the frontmost element (O(1))
        // Precondition: Queue not empty
        void dequeue();


        // Description: Returns a copy of the frontmost element (O(1))
        // Precondition: Queue not empty
        int peek() const;


        // Description: Returns true if and only if queue empty (O(1))
        bool isEmpty() const;
};

Thanks!

In: Computer Science

Powerball. In this assignment you are to code a program that selects 20 random non-repeating positive...

Powerball. In this assignment you are to code a program that selects 20 random non-repeating positive numbers (the Powerball Lottery numbers), inputs three numbers from the user and checks the input with the twenty lottery numbers. The lottery numbers range from 1 to 100. The user wins if at least one input number matches the lottery numbers.

As you program your project, demonstrate to the lab instructor displaying an array passed to a function. Create a project titled Lab6_Powerball. Declare an array wins of 20 integer elements.

Define the following functions:

  • Define function assign() that takes array wins[] as a parameter and assigns 0 to each element of the array.

    Hint: Array elements are assigned 0, which is outside of lottery numbers' range, to distinguish elements that have not been given lottery numbers yet.

    Passing an array as a parameter and its initialization is done similar to the code in this program.

    • #include <iostream>
      using std::cout; using std::endl; using std::cin;
      
      // initializes the array by user input
      void fillUp(int [], int);
      
      int main( ) {
         const int arraySize=5;
         int a[arraySize];
      
         fillUp(a, arraySize);
      
         cout << "Echoing array:\n";
         for (int i = 0; i < arraySize; ++i)
            cout << a[i] << endl;
      }
      
      // fills upt the array "a" of "size"
      void fillUp(int b[], int size) {
      
         cout << "Enter " << size << " numbers: ";
         for (int i = 0; i < size; ++i)
            cin >> b[i];
      }
  • Define a predicate function check() that takes a number and the array wins[] as parameters and returns true if the number matches one of the elements in the array, or false if none of the elements do. That is, in the function, you should write the code that iterates over the array looking for the number passed as the parameter. You may assume that the number that check() is looking for is always positive.

    Hint: Looking for the match is similar to looking for the minimum number in this program.

    • #include <iostream>
      using std::cout; using std::endl; using std::cin;
      
      int main(){
      
         const int arraySize=5;
         int numbers[arraySize];  // array of numbers
      
         // entering the numbers
         cout << "Enter the numbers: ";
         for(int i=0; i < arraySize; ++i)
              cin >> numbers[i];
      
        // finding the minimum
        int minimum=numbers[0]; // assume minimum to be the first element
        for (int i=1; i < arraySize; ++i) // start evaluating from second
              if (minimum > numbers[i]) 
                 minimum=numbers[i];
        
        cout << "The smallest number is: " << minimum << endl;
      
      }
      
  • Define a function draw() that takes array wins as a parameter and fills it with 20 random integers whose values are from 1 to 100. The numbers should not repeat.

    Hint: Use srand(), rand() and time() functions that we studied earlier to generate appropriate random numbers from 1 to 100 and fill the array. Before the selected number is entered into the array wins, call function check() to make sure that the new number is not already in the array. If it is already there, select another number.

    The pseudocode for your draw() function may be as follows:

        declare a variable "number of selected lottery numbers so far",
                     initialize this variable to zero
        while (the_number_of_selected_elements is less than the array size)
             select a new random number
             call check() to see if this new random number is already in the array
             if the new random number is not in the array
                 increment the number of selected elements
                 add the newly selected element to the array
    
       
  • Define function entry() that asks the user to enter a single number from 1 to 100 and returns this value.
  • Define function printOut() that outputs the selected numbers and user input.
    Hint: Outputting the array can be done similar to echoing it in this program.
    • #include <iostream>
      using std::cout; using std::endl; using std::cin;
      
      // initializes the array by user input
      void fillUp(int [], int);
      
      int main( ) {
         const int arraySize=5;
         int a[arraySize];
      
         fillUp(a, arraySize);
      
         cout << "Echoing array:\n";
         for (int i = 0; i < arraySize; ++i)
            cout << a[i] << endl;
      }
      
      // fills upt the array "a" of "size"
      void fillUp(int b[], int size) {
      
         cout << "Enter " << size << " numbers: ";
         for (int i = 0; i < size; ++i)
            cin >> b[i];
      }
      

The pseudocode your function main() should be as follows:

  main(){
      declare array and other variables
  
      assign(...) // fill array with 0
      draw(...)       // select 20 non-repeating random numbers
      iterate three times
            entry(...)      // get user input
            use check () to compare user input against lottery numbers
            if won state and quit
      printOut(...)   // outputs selected lottery numbers
  }
  

Note: A program that processes each element of the array separately (i.e. accesses all 20 elements of the array for assignment or comparison outside a loop) is inefficient and will result in a poor grade.

Note 2: For your project, you should either pass the array size (20) to the functions as a parameter or use a global constant to store it. Hard-coding the literal constant 20 in function definitions that receive the array as a parameter is poor style. It should be avoided.

In: Computer Science