In: Computer Science
(write a program that get the numbers from user and search the file numbers.text for that value. in C++) numbers.txt: 10 23 43 5 12 23 9 8 10 1 16 9
you must to have the exact output:
Enter a number: 10
10 last appears in the file at position 9
Enter a number: 29
29 does not appear in the file
Enter a number: 9
9 last appears in the file at position 12
Enter a number:
In: Computer Science
Please, write code in c++. Using iostream library
Most modern text editors are able to give some statistics about
the text they are editing. One nice statistic is the average word
length in the text. A word is a maximal continuous sequence of
letters ('a'-'z', 'A'-'Z'). Words can be separated by spaces,
digits, and punctuation marks. The average word length is the sum
of all the words' lengths divided by the total number of
words.
For example, in the text "This is div2 easy problem". There are 5 words: "This"is"div"easy" and "problem". The sum of the word lengths is 4+2+3+4+7 = 20, so the average word length is 20/5 = 4.
Given a text, return the average word length in it. If there are no words in the text, return 0.0.
Input
The first line will contain the text of length between 0 and 50
characters inclusive. Text will contain only letters ('a'-'z',
'A'-'Z'), digits ('0'-'9'), spaces, and the following punctuation
marks: ',', '.', '?', '!', '-'. The end of text will be marked with
symbol '#' (see examples for clarification).
Output
Output should contain one number - the average length. The returned
value must be accurate to within a relative or absolute value of
10-9.
Samples:
| № | Input | Output |
|---|---|---|
| 1 | This is div2 easy problem.# | 4.0 |
| 2 | a bc# | 1.5 |
| 3 | w84lFC1hD2ot2?43 Jnw67Kmt8KhOQn# | 2.714285714 |
In: Computer Science
Compare Google and Yahoo in the impact of data sharing and data privacy on on-line consumers in the U.S.
(100 words min )
In: Computer Science
Write a Scheme function that takes two integers and returns the list of all integer numbers between these two integers (inclusively) in increasing order. (numbers 10 20) (10 11 12 13 14 15 16 17 18 19 20)
Please explain every step.
In: Computer Science
C++, Need to create a code that will calculated the statistics for character input?
This is the prompt for the code. I truly understand nothing of what it's asking.
Ask the user for one character (terminated by a carriage return).Using flow control, classify the character into one of these categories:
1) vowel
2) consonant
3) digit (0-9)
4) other
Output the character input, its numeric decimal value, and the classification. Total up the number of each type of character entered. After the character is entered, ask the user if they want to continue (Y/N). When they enter N, you can stop prompting for more characters. Make sure to validate for Y or N data entry. Then display the total number of each type of characters entered.
In: Computer Science
For the following Paging configuration discuss what must be done
to ensure a processes address space is not violated.
Process with five pages of 2048 words.
In: Computer Science
Find the bit length of a LAN if the data rate is 1 Gbps and the medium length in meters for a communication between two stations is 200 m. Assume the propagation speed in the medium is 2 *10^8 m/s.
In: Computer Science
Objectives
Problem Specification
Skip by 7’s and 9’s
1. Generate n numbers between -100 and 100.
2. If the value is multiple of 7 or 9, replaced by *
3. Then change to new line after the multiple of 7 or 9 is appeared
Design Specification
Example:
In: Computer Science
Java Program. Please read carefully. i need the exact same output as below. if you unable to write the code according to the question, please dont do it. thanks
To the HighArray class in the highArray.java program (Listing 2.3), add the following methods:
1. getMax() that returns the value of the highest key (value) in the array without removing it from the array, or –1 if the array is empty.
2. removeMax() that removes the item with the highest key from the array.
3. reverse() method for the HighArray class to reverse the order of elements of the array.
Sample output of HighArray class once you do the above methods:
current array items: 77 99 44 55 22 88 11 0 66 33
Can't find 35
array items after delete some values: 77 44 22 88 11 66 33
the Max is 88
the array after calling max method: 77 44 22 88 11 66 33
the array after calling remove max method: 77 44 22 11 66 33
the new max is 77
the array after calling reverse method 33 66 11 22 44 77
In: Computer Science
Given an IP address and mask of 192.168.0.0 /24 (address / mask), design an IP addressing scheme that satisfies the following requirements. Network address/mask and the number of hosts for Subnets A and B will be provided by your instructor.
|
Subnet |
Number of Hosts |
|
Subnet A |
55 |
|
Subnet B |
25 |
The 0th subnet is used. No subnet calculators may be used. All work must be shown on the other side of this page.
|
Subnet A |
|||
|
Specification |
Student Input |
Points |
|
|
Number of bits in the subnet |
(5 points) |
||
|
IP mask (binary) |
|||
|
New IP mask (decimal) |
|||
|
Maximum number of usable subnets (including the 0th subnet) |
|||
|
Number of usable hosts per subnet |
|||
|
IP Subnet |
|||
|
First IP Host address |
|||
|
Last IP Host address |
|||
|
Subnet B |
|||
|
Specification |
Student Input |
Points |
|
|
Number of bits in the subnet |
(5 points) |
||
|
IP mask (binary) |
|||
|
New IP mask (decimal) |
|||
|
Maximum number of usable subnets (including the 0th subnet) |
|||
|
Number of usable hosts per subnet |
|||
|
IP Subnet |
|||
|
First IP Host address |
|||
|
Last IP Host address |
|||
Host computers will use the first IP address in the subnet. The network router will use the LAST network host address. The switch will use the second to the last network host address.
Write down the IP address information for each device:
|
Device |
IP address |
Subnet Mask |
Gateway |
Points |
|
PC-A |
(5 points) |
|||
|
R1-G0/0 |
N/A |
|||
|
R1-G0/1 |
N/A |
|||
|
S1 |
N/A |
|||
|
PC-B |
In: Computer Science
In java please, thank you :) For this assignment, you will continue your practice with dynamic structures. Specifically, you will be implementing a different version of a linked-list, called a Queue. Queues are very important and useful linear structures that are used in many applications. Follow the link below for a detailed description:
tutorialspoint - Queue (Links to an external site.)
The queue description above uses an array implementation for examples. As usual you will be not be using arrays, you will be using linked-lists. Specifically a singly-linked list.
Our job will be to implement the four basic queue methods which are enqueue(), dequeue(), peek() and isEmpty() as described in the tutorial mentioned above. You will not need to implement the isFull() method since we will be using linked-lists and linked-lists are theoretically never full.
For this assignment we will need to implement an uncommon version of enqueue(). In our version, if the element that is being processed is already in the queue then the element will not be enqueued and the equivalent element already in the queue will be placed at the end of the queue.
Additionally, you will be implementing a special kind of queue called a circular queue. A circular queue is a queue where the last position is connected back to the first position to make a circle. Therefore it does not have the traditional front and back data elements. It only has one data element, called rear that keeps track of the last element in the queue.
This structurally similar to a circular singly-linked list described here:
tutorialspoint - Circular Linked List (Links to an external site.)
The program's input will a single string that consists of single-character elements. You program will process each character in the string according the descriptions below. Where "->" signifies the front of the queue (blue designates input, red designates output):
ABCD (nothing will be outputted) ABCDA* B C D A
ABCD* -> A B C D
ABCD$ peek: A
ABCD#* ->
ABCD!* -> B C D
a The illegal character 'a' was encountered in the input stream.
Programming Notes:
Programming Rules:
Please use started code:
import java.util.Scanner; // Import the Scanner class
public class Homework7 {
public static void main(String[] args) {
// place your solution here
}
}
class SLLNode {
public char data;
public SLLNode next;
public SLLNode(char c) {
data = c;
next = null;
}
}
class Queue {
public SLLNode rear;
public Queue() {
// place your solution here
}
public void enqueue(char c) {
// place your solution here
}
public SLLNode dequeue() {
// place your solution here
}
public char peek() {
// place your solution here
}
public boolean isEmpty() {
// place your solution here
}
}
In: Computer Science
2.1) What is the kernel mode?
2.2) What is the user mode?
2.3) Which mode has more different instructions?
2.4) Why do we need these two modes in designing an operating system?
In: Computer Science
A byte is made up of 8 bits although a byte is rarely represented as a string of binary digits or bits. Instead, it is typically presented as a pair of hexadecimal digits where each digit represents 4 bits or half a byte or "nibble." We have been reading in hex digits and outputting their decimal value, but what we really want to do is create a byte from a pair of hex digits read from input.
Create a C program that:
The printf() function supports outputting an integer as a hexadecimal number using the %x (where the hexadecimal letters are presented in lower-case) and %X (where the hexadecimal letters are presented in upper-case).
To pack two integers that have values represented with only 4 bits, you need to perform two operations with the integers:
After the shift and the OR, the first integer will not have the lower 8 bits (byte) set to the values represented by the two characters read from input.
In: Computer Science
Write a program that uses a two dimensional array to store the highest and lowest temperatures for each month of the calendar year. The temperatures will be entered at the keyboard. This program must output the average high, average low, and highest and lowest temperatures of the year. The results will be printed on the console. The program must include the following methods:
Directions
In: Computer Science