Answer:
Error - At least one public class is required in main file
if you change it too:
public class main{
public static void main(String[] args) {
int x=5 ,y = 10;
if (x>5 && y>=2) System.out.println("Class 1");
else if (x<14 || y>5) System.out.println(" Class 2");
else System.out.println(" Class 3"); }
// end of main
}
// end of class.
than it will say Class 2.
Explanation:
n
What options are available in the Lookup Wizard? Check all that apply.
label the field
sort the records
filter the records
o adjust the column width
O adjust the header height
reduce the number of columns
Je
set where to get lookup field values
Answer:
Label the field
sort records
adjust the column width
set where to get lookup fields
Explanation:
Write a recursive method named factorial that accepts an integer n as a parameter and returns the factorial of n, or n!. A factorial of an integer is defined as the product of all integers from 1 through that integer inclusive. For example, the call of factorial(4) should return 1 * 2 * 3 * 4, or 24. The factorial of 0 and 1 are defined to be 1. You may assume that the value passed is non-negative and that its factorial can fit in the range of type int. Do not use loops or auxiliary data structures; solve the problem recursively.
Answer:
The function in Python is as follows:
def factorial(n):
if n == 1 or n == 0:
return n
else:
return n*factorial(n-1)
Explanation:
This defines the function
def factorial(n):
This represents the base case (0 or 1)
if n == 1 or n == 0:
It returns 0 or 1, depending on the value of n
return n
If n is positive, then this passes n - 1 to the factorial function. The process is repeated until n = 1
else:
return n*factorial(n-1)
Explain the difference between invention and innovation?
In c please
Counting the character occurrences in a file
For this task you are asked to write a program that will open a file called “story.txt
and count the number of occurrences of each letter from the alphabet in this file.
At the end your program will output the following report:
Number of occurrences for the alphabets:
a was used-times.
b was used - times.
c was used - times .... ...and so, on
Assume the file contains only lower-case letters and for simplicity just a single
paragraph. Your program should keep a counter associated with each letter of the
alphabet (26 counters) [Hint: Use array|
| Your program should also print a histogram of characters count by adding
a new function print Histogram (int counters []). This function receives the
counters from the previous task and instead of printing the number of times each
character was used, prints a histogram of the counters. An example histogram for
three letters is shown below) [Hint: Use the extended asci character 254]:
Answer:
#include <stdio.h>
#include <ctype.h>
void printHistogram(int counters[]) {
int largest = 0;
int row,i;
for (i = 0; i < 26; i++) {
if (counters[i] > largest) {
largest = counters[i];
}
}
for (row = largest; row > 0; row--) {
for (i = 0; i < 26; i++) {
if (counters[i] >= row) {
putchar(254);
}
else {
putchar(32);
}
putchar(32);
}
putchar('\n');
}
for (i = 0; i < 26; i++) {
putchar('a' + i);
putchar(32);
}
}
int main() {
int counters[26] = { 0 };
int i;
char c;
FILE* f;
fopen_s(&f, "story.txt", "r");
while (!feof(f)) {
c = tolower(fgetc(f));
if (c >= 'a' && c <= 'z') {
counters[c-'a']++;
}
}
for (i = 0; i < 26; i++) {
printf("%c was used %d times.\n", 'a'+i, counters[i]);
}
printf("\nHere is a histogram:\n");
printHistogram(counters);
}
com to enjoy dont give fkin lecture hsb-tnug-fyt
Answer:
This is my faverrrrate part of computer science lol.
Explanation:
The project downloaded contains a package (folder) named Q1 within the src folder. Inside Q1 is a Java class named Questions. The purpose of Question 1 is to examine your understanding of loops and branching conditions. You should implement all of your code for this question in the main method of the Questioni class. While significant detail is provided below to be sure you undertand what is required, please note that the amount of code required to solve this question (Parts a-c) is less than 10 lines (total). In the Question1 class, you are given a line of code that generates a random number between 0 and 1. Math.random(): //generates number between 0 and 1 val
You are to create a loop which, in each iteration, generates a new random value, assigns it to val using the line provided and checks to see if that val is greater than 0.5. If val is greater than 0.5, a variable named counter should be incremented. The loop should continue this process (generate random value, check if it is greater than 0.5) until a total of three random numbers generated are greater than 0.5 (values do not have to be consecutive). You should also use the variable named numIterations, which is included for you, to track how many iterations of your loop were required for you to generate three random numbers greater than 0.5. A printin() statement is included for you that displays the value of numlterations. As an example of how the program should behave, if the following sequence of random numbers are randomly generated from your loop
0.3, 0.7,0.2, 0.6,0.9
then numIterations would equal 5 (the third value greater than 0.5 occured on the fifth iteration).
If
0.6, 0.8, 0.75
was the random sequence of numbers generated by your loop, then numlterations would equal 3 (the third value greater than 0.5 occured on the third iteration).
These are two examples to illustrate the scenario given in Question 1. Since at each iteration of your loop the number generated is random, the value of numIterations that your program observes may be any value greater than or equal to 3. Note that your program does not need to print out each of the random values that it generates. The steps to solve Question 2 are broken down as follows.
a. Implement a branching condition that increases the variable counter by 1 if val is larger than 0.5 1
b. Add a loop around the code created in Part a that continues until counter equals 3.
c. Use the variable numlterations to count how many times your loop iterates.
Answer:
ok where do i put anwaer?
Explanation:
Explaining Invalid Data
what happens if date is entered in a feld without meeting the validation mal
Answer:
An error appears and the record cannot be saved
Explanation:
edge 2021
Write a function, stringify_digit that takes a single digit (integer) and returns the corre-sponding digit as a string. For example, stringify_digit(9) returns "9" and stringify_digit(0)returns "0". You may assume that only the digits 0 to 9 will be passed in as argumentsto your function. You may not use the str() function for this function.
Answer:
The function in Python is as follows:
def stringify_digit(digit):
dig = "%s" % digit
return dig
Explanation:
This defines the function
def stringify_digit(digit):
This converts the input parameter to string
dig = "%s" % digit
This returns the string equivalent of the input parameter
return dig
When developing an algorithm to solve a problem, which of these steps can help you design the solution for the problem?
Answer:
3 is the answer please mark me brainlist
Explanation:
ok
When determining the statement of purpose for a database design, what is the most important question to ask?
O Who will use the database?
O Should I use the Report Wizard?
O How many copies should I print?
O How many tables will be in the database?
Answer: A. Who will use the database?
Explanation:
When determining the statement of purpose for a database design,the most important question to ask is Who will use the database?
What is the purpose of statement of purpose for a database ?Statement of purpose in a data base is very essential to know more about the database, this is why it is important to ask the question Who will use the database?
This question help the programmer to know the kind of data that will be running at the database so as make sure the database serve the required purpose.
Therefore option A is correct.
Read more about database at:
https://brainly.com/question/518894
#SPJ9
what is a web client
Answer:
A Web client typically refers to the Web browser in the user's machine or mobile device. It may also refer to extensions and helper applications that enhance the browser to support special services from the site.
hope this helps
have a good day :)
Explanation:
List any two programs that are required to play multimedia products
List any two programs that are required to create multimedia products
Answer:
the two programs to play multimedia products are;windows media player and VLC media player and the two programs to create multimedia products are;photoshop and PowerPoint
Plz answer it’s timed
Answer: the third one
Explanation:
just trust me, the other ones dont mke sense to what I know about the subject, which is a lot
Write a function to calculate the distance between two points Distance( x1, y1,x2.2) For example Distance(0.0,3.0, 4.0.0.0) should return 5.0 Use the function in main to loop through reading in pairs of points until the all zeros are entered printing distance with two decimal precision for each pair of points.
For example with input
32 32 54 12
52 56 8 30
44 94 4439 6
5 19 51 91 7.5
89 34 0000
Your output would be:__________.
a. 29.73
b. 51.11
c. 55.00
d. 73.35
e. 92.66
Answer:
The function in Python3 is as follows
def Distance(x1, y1, x2, y2):
dist = ((x1 - x2)**2 +(y1 - y2)**2)**0.5
return dist
Explanation:
This defines the function
def Distance(x1, y1, x2, y2):
This calculates distance
dist = ((x1 - x2)**2 +(y1 - y2)**2)**0.5
This returns the calculated distance to the main method
return dist
The results of the inputs is:
[tex]32, 32, 54, 12 \to 29.73[/tex]
[tex]52,56,8,30 \to 51.11[/tex]
[tex]44,94,44,39\to 55.00[/tex]
[tex]19,51,91,7.5 \to 84.12[/tex]
[tex]89,34,00,00 \to 95.27[/tex]
Who is MrBeast?
Answer the question correctly and get 10 points!
Answer: MrBeast is a y0utuber who has lots of money
Explanation:
Answer:
He is a You tuber who likes to donate do stunts and best of all spend money.
It's like he never runs out of money.
Explanation:
Suppose that a minus sign in the input indicates pop the stack and write the return value to standard output, and any other string indicates push the string onto the stack. Further suppose that following input is processed:
this parrot - wouldn't voom - if i put -- four thousand --- volts - through it -
What are the contents (top to bottom) left on the stack?
a. through wouldn't this.
b. this wouldn't through.
c. it through wouldn't.
d. it through volta.
e. volts through it.
Answer:
e. volts through it
Explanation:
volts through it
The contents (top to bottom) left on the stack is volts through it. Thus, option E is correct.
What is standard output?When a computer program begins execution, standard streams are interconnected input and output channels of communication between the program and its surroundings. The three I/O connections are known as standard input (stdin), standard output (stdout), and standard error (stderr).
A negative sign in the input indicates that the stack should be popped, and the return value should be sent to standard output, whereas any other string means that the string should be pushed into the stack. Assume that the following input is processed: this parrot would not voom if I pushed — four thousand —- volts - through it.
The contents of the stack (from top to bottom) are volts via it. As a result, option E is correct.
Learn more about standard output here:
https://brainly.com/question/30054426
#SPJ5
Write a function template that accepts an argument and returns its absolute value. The absolute value of a number is its value with no sign. For example, the absolute value of -5 is 5, and the absolute value of 2 is 2. Test the template in a simple driver program being sure to send the template short, int, double, float, and long data values.
Answer:
The function in Java is as follows:
public static double func(double num){
num = Math.abs(num);
return num;
}
Explanation:
This defines the function
public static double func(double num){
This determines the absolute function of num
num = Math.abs(num);
This returns the calculated absolute value
return num;
}
write a object oriented c++ program
Answer:
I don't know how to code C++
Explanation:
Complete the sentence.
In your program, you can open
In your program, you can open a file using the open() function in Python.
What is the program about?A high-level, all-purpose programming language is Python. Code readability is prioritized in its design philosophy, which makes heavy use of indentation. Python uses garbage collection and has dynamic typing.
It supports a variety of programming paradigms, such as functional, object-oriented, and structured programming. The open() function in Python allows you to open a file, read its contents, and perform various operations on it, such as writing, appending, etc.
Learn more about program on:
https://brainly.com/question/26642771
#SPJ1
Rideshare companies like Uber or Lyft track the x,y coordinates of drivers and customers on a map. If a customer requests a ride, the company's app estimates the minutes until the nearest driver can arrive. Write a method that, given the x and y coordinates of a customer and the three nearest drivers, returns the estimated pickup time. Assume drivers can only drive in the x or y directions (not diagonal), and each mile takes 3.5 minutes to drive. All values are doubles; the coordinates of the user and of the drivers are stored as arrays of length 2. 289222.1780078.qx3zqy7
Answer:
The program in Java is as follows:
import java.util.*;
public class Main{
public static void main (String[]args){
Scanner input = new Scanner(System.in);
double user[] = new double[2]; double dr1[] = new double[2];
double dr2[] = new double[2]; double dr3[] = new double[2];
System.out.print("Enter user coordinates: ");
for(int i =0;i<2;i++){ user[i] = input.nextDouble(); }
System.out.print("Enter driver 1 coordinates: ");
for(int i =0;i<2;i++){ dr1[i] = input.nextDouble(); }
System.out.print("Enter driver 2 coordinates: ");
for(int i =0;i<2;i++){ dr2[i] = input.nextDouble(); }
System.out.print("Enter driver 3 coordinates: ");
for(int i =0;i<2;i++){ dr3[i] = input.nextDouble(); }
double dr1dist = Math.abs(user[0] - dr1[0]) + Math.abs(user[1] - dr1[1]);
double dr2dist = Math.abs(user[0] - dr2[0]) + Math.abs(user[1] - dr2[1]);
double dr3dist = Math.abs(user[0] - dr3[0]) + Math.abs(user[1] - dr3[1]);
System.out.println("Estimated pickup time of driver 1 "+(3.5 * dr1dist)+" minutes");
System.out.println("Estimated pickup time of driver 2 "+(3.5 * dr2dist)+" minutes");
System.out.println("Estimated pickup time of driver 3 "+(3.5 * dr3dist)+" minutes");
}
}
Explanation:
The following array declarations are for the customer and the three drivers
double user[] = new double[2]; double dr1[] = new double[2];
double dr2[] = new double[2]; double dr3[] = new double[2];
This prompts the user for the customer's coordinates
System.out.print("Enter user coordinates: ");
This gets the customer's coordinate
for(int i =0;i<2;i++){ user[i] = input.nextDouble(); }
This prompts the user for the driver 1 coordinates
System.out.print("Enter driver 1 coordinates: ");
This gets the driver 1's coordinate
for(int i =0;i<2;i++){ dr1[i] = input.nextDouble(); }
This prompts the user for the driver 2 coordinates
System.out.print("Enter driver 2 coordinates: ");
This gets the driver 2's coordinate
for(int i =0;i<2;i++){ dr2[i] = input.nextDouble(); }
This prompts the user for the driver 3 coordinates
System.out.print("Enter driver 3 coordinates: ");
This gets the driver 3's coordinate
for(int i =0;i<2;i++){ dr3[i] = input.nextDouble(); }
This calculates the distance between driver 1 and the customer
double dr1dist = Math.abs(user[0] - dr1[0]) + Math.abs(user[1] - dr1[1]);
This calculates the distance between driver 2 and the customer
double dr2dist = Math.abs(user[0] - dr2[0]) + Math.abs(user[1] - dr2[1]);
This calculates the distance between driver 3 and the customer
double dr3dist = Math.abs(user[0] - dr3[0]) + Math.abs(user[1] - dr3[1]);
The following print statements print the estimated pickup time of each driver
System.out.println("Estimated pickup time of driver 1 "+(3.5 * dr1dist)+" minutes");
System.out.println("Estimated pickup time of driver 2 "+(3.5 * dr2dist)+" minutes");
System.out.println("Estimated pickup time of driver 3 "+(3.5 * dr3dist)+" minutes");
search for five ms excel terms
Answer:
work book, work sheet, cell, columns and rows
Write a Java program named Problem 3 that prompts the user to enter two integers, a start value and end value ( you may assume that the start value is less than the end value). As output, the program is to display the odd values from the start value to the end value. For example, if the user enters 2 and 14, the output would be 3, 5, 7, 9, 11, 13 and if the user enters 14 and 3, the output would be 3, 5, 7, 9, 11, 13.
Answer:
hope this helps
Explanation:
import java.util.Scanner;
public class Problem3 {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
System.out.print("Enter start value: ");
int start = in.nextInt();
System.out.print("Enter end value: ");
int end = in.nextInt();
if (start > end) {
int temp = start;
start = end;
end = temp;
}
for (int i = start; i <= end; i++) {
if (i % 2 == 1) {
System.out.print(i);
if (i == end || i + 1 == end) {
System.out.println();
} else {
System.out.print(", ");
}
}
}
}
}
PLEASE HELP ME ASAP ITS IMPORTANT
How can technical writers help readers focus on important information in a set of instructions?
Technical writers can bring a reader's attention to important details in a set of instructions by ___.
1. adding an explanation and caution
2. using a highlighting technique
3. repeating the information
4. adding graphics to the introduction
Answer:
2. using a highlighting technique
Explanation:
highlighting is for to draw attention
Why is it important to isolate evidence-containing devices from the internet?
To save the battery
To hide their location
Devices can be remotely locked or wiped if connected
It is not important to isolate the devices
Answer:
C.
Devices can be remotely locked or wiped if connected
Explanation:
First one who answers gets brainiest
Answer:
thank for the point anyway
Which security measure provides protection from IP spoofing?
A ______ provides protection from IP spoofing.
PLEASE HELP I need to finish 2 assignments to pass this school year pleasee im giving my only 30 points please
Answer:
An SSL also provides protection from IP spoofing.