How many ways are there to arrange the letters a, b, c, d, e, and f such that a is not directly followed by either b or c? For example, “abdef c” and “acdef b” are both invalid, but “adbcef” is valid.
In: Computer Science
>>>>>C#<<<<<
A. Number Frequency-Arrays
Random Numbers-Methods
B. Word Count -String Processing
[01]
C. Recursion
By using recursion, write a program to:
D. Matrix Manipulation
Write a C# program to Perform Matrix Multiplication. [02]
Note:-
The matrix multiplication can be performed only if:
In: Computer Science
In: Computer Science
Explain when and how the following are constructed and used.
software engineering
a. Data Flow Diagrams
b. Activity Diagrams
In: Computer Science
The Strings Object in particular is full of useful classes and methods. You can parse and manipulate strings using several methods of the String class. These methods enable you to count characters, find and extract characters and substrings, replace characters and substrings, combine characters and substrings, and compare strings.
Questions to answer:
1. Identify three such methods and discuss how they are used. Then use them in simple relevant examples
2. As you research the String class, what are some of the most
popular uses of substring searching in use today?
3. Are there any uses of strings not covered by the String class or
mentioned in the prompt?
4. Are there other classes that inherit from the String
class?
5. How does the String class extend or support the Array class?
In: Computer Science
Answer as soon as possible
Given a number, find the sum of all the unique multiples of
particular
numbers up to but not including that number.
If we list all the natural numbers below 20 that are multiples of 3
or 5, we
get 3, 5, 6, 9, 10, 12, 15, and 18.
The sum of these multiples is 78.
Given Code:
public int getSumOfMultiples(int i, int[] set) {
// Solution
return 0;
}
In: Computer Science
Write a program in C that reads prompts the user for a positive integer and then prints out that number in base 16, base 8 and base 2.
In: Computer Science
[Computer Science Question]
Compare and Contrast the trade-offs associated with using C++ in
comparison to Python. How do the characteristics of the languages
impact the amount of memory each language occupies. How do memory
considerations impact each languages real world
implementations?
In: Computer Science
In this assignment you must submit TWO different programs both of which accomplish the same thing but in two different ways.
Using NetBeans, create a program that prompts the user for a sentence. Then the program displays the position of where the lowercase letter 'a' appears everywhere in the sentence. Here is a sample of the input and output:
Enter a sentence
for the night is dark and full of terrors.
The lowercase letter 'a' appears at character position 18
The lowercase letter 'a' appears at character position
22
Write TWO different programs that accomplishes the above using different techniques. Take a look at the JavaDocs for the String methods available to you. For example, one way is you might use the 'charAt()' method while your second program uses 'indexOf()'.
please send me the solution in java as soon as possible.
In: Computer Science
what is the time complexity of those ?
//TODO - Question 18
public static int[][] fillRandomArray4(int n) {
int[][] arr = new int[n][n];
for(int i = 0; i < arr.length;
i++) {
arr[i] = new
int[] {(int)(Math.random() * 101),
(int)(Math.random() *
101),
(int)(Math.random() *
101)};
}
return arr;
}
//TODO - Question 19
public static int factorial(int n) {
if(n == 1 || n == 0) {
return 1;
}
return n * factorial(n-1);
}
//TODO - Question 20 - assume str.length() == n
public static boolean isPalindrome(String str) {
if(str.length() == 0 ||
str.length() == 1) {
return
true;
}
if(str.charAt(0) !=
str.charAt(str.length()-1)) {
return
false;
} else {
return
isPalindrome(str.substring(1,str.length()-1));
}
}
In: Computer Science
Given the following inheritance Diagram structure: Fruit: Apple and Orange, Apple: GoldenDelicious and MacIntosh Create a C++ Program that simulate the inheritance structure above. Fruit class should have at least two attributes name and color, getters and setters in addition to a method display() just to display the fruit details. Define the classes Apple, Orange, GoldenDelicious and MacIntosh All of which you can choose the attributes, constructors and methods of your choice, but all should have a redefinition of the method display() In the main create different objects of different classes, assign names and colors and demonstrate the dynamic binding call of the method display using (Polymorphism) GoldenDelicious MacIntosh Fruit Apple Orange
In: Computer Science
Execute SQL queries to get the countries in which the population has fallen from one year to the next, and the years in which it has occurred. Dump the output in the following format:
| country | year | population | year | population |
| 1 | 2005 | 82500849 | 2006 | 82437995 |
| 1 | 2006 | 82437995 | 2007 | 82314906 |
(...)
And so on.
These are the SQL files:
Tables: pastebin.com/xw0j1NAM
Data: pastebin.com/hnpFT3QR
In: Computer Science
Exercise 12.4: Use a browser's developer tools to view the DOM
tree of the document in Fig. 12.4. Look at the document tree of
your favorite website. Explore the information these tools give you
in the right panel(s) about an element when you click it.
Please use the Chrome browser:
Write a paragraph or two about what you learned about using the Chrome developer tools.
In: Computer Science
C++ You should have one main function + 4 other functions for your submission for this lab. you have no need for extra functions beyond that, and you should not have less. You may use any pre existing functions already defined in class or a previous lab.
-Write a function storeTotal(,) that takes two arguments of type double, and has a return type of type Boolean. This function will take the number 256 and divide it by the second parameter, and add the result to the first parameter. It will return true afterwards.
-You should be making mindful decisions of which parameters should be call by value and which should be call by reference.
-If dividing by the second parameter would result in a run time error, the program does not do the calculation, and instead returns false.
-Ask the user to input two numbers, one at a time, discarding excess input each time.
-The program should keep looping until the user enters valid input.
-Once the user enters input, call function storeTotal appropriately.
-Whether storeTotal runs successfully (returns true) or not (returns false), display an appropriate message.
-Output the results of the variable that is cumulating value. This number is ALWAYS displayed in scientific notation, accurate to 3 decimal places
Repeat this 2 times.
Sample Output
How much do you already have? A
Invalid Input!
How much do you already have? Bck
Invalid Input!
How much do you already have? 42.4
What is the split factor? ,!
Invalid Input!
What is the split factor? 3.5
You now have 1.155e+002
How much do you already have? 35.6
What is the split factor? 0
That didn't go well, you still have 3.560e+001
*Explanation* 256/3.5 and then added to 42.4 gives 115.54, which, in scientific notation, gives the output above.
*Note* How scientific notation is displayed can vary from compiler to compiler, as long as you are getting it done through proper knowledge of C++ then the output does not need to look exactly the same.
In: Computer Science
/*instructions: please do not change the general structure of the code that I already have
please write it in C programming
Define the interface for a queue ADT and implement it in two
ways: one with a dummy node (or nodes) and one without.
In addition to the two standard queue functions you’ll need a
function to create/initialize an empty queue,
a function to free an existing queue (which may not be
empty),
and a function to return the size (number of keys) in the
queue.
All functions should be as efficient as possible, e.g., the
complexity of enqueue and dequeue must be O(1).
An additional requirement is that the underlying data structure
should not be a doubly-linked list.*/
#include <stdio.h>
#include <stdlib.h>
typedef struct node{
int num;
struct node *next;
}Node;
typedef struct{
Node* front
Node* rear;
int size;
}Queue;
//Define the interface for a queue ADT
Queque* initializeQueque()
{
}
Queque* insert(int item)
{
}
Queque* delete()
{
}
void printList(Node* Q)
{
}
//get the size of the queque at postion [-1]
//return the size (number of keys) in the queue.
int getsize(Node* Q)
{
}
int main()
{
int option,item;
Node* Queque;
while(1){
printf("1.Insert number to queque\n2.Delete number from
queque\n3.Display numbers in queque\n4.Exit\nEnter a
option:");
scanf("%d",&option);
switch(option){
case 1:
printf("Enter the number:");
scanf("%d",&item);
Queque=insert(item);
break;
case 2:
Queque=delete();
break;
case 3:
printList(Queque);
break;
case 4:
return 1;
default:
printf("\nWrong input!\n");
break;
}
}
}
In: Computer Science