Write Method Countlines String Infilename Class Fileutility Reads Binary Byte File Name In Q43785367
Write a method countLines(String inFilename) of a classFileUtility which reads a binary byte file with name inFilenameusing FileInputStream. The method returns the no. of linescontaining comments starting with “//” with optional spaces (butnot other characters) before it. Each line is terminated by ‘n’.You may write other methods if necessary. Handle possible exceptionby outputting a suitable message if an exception occurs.
Expert Answer
Answer to Write a method countLines(String inFilename) of a class FileUtility which reads a binary byte file with name inFilename …
Write Method Function Find Index Smallest Number Array Type Int Declare Array Size 7 Fill Q43790112
Write a method/function to find the index of the smallest numberin an array of type int. Declare the array size to be 7 and fillthe array from the keyboard. The method should take the array as aparameter and return the index of the smallest number as the returnvalue.
using c++ language
Expert Answer
Answer to Write a method/function to find the index of the smallest number in an array of type int. Declare the array size to be 7…
Write Method Function Find Smallest Number Array Type Int Declare Array Size 7 Fill Array Q43790118
Write a method/function to find the smallest number in an arrayof type int. Declare the array size to be 7 and fill the array fromthe keyboard. The method should take the array as a parameter andreturn the smallest number as the return value.
using c++
Expert Answer
Answer to Write a method/function to find the smallest number in an array of type int. Declare the array size to be 7 and fill the…
Write Method Getsum Takes Four Digit Number Returns Square Sum First Two Digits Last Two D Q43895231
java
A) Write a method getSum that takes a four digit number and returns the square of the sum of the first two digits and the last two digits. For example that call getSum(1011) would return (10+11)? B) Write a method getAll which finds and prints all four digit numbers for which the square of the sum of the first two digits and the last two digits equal the number itself. For example, 3025 = (30 + 25)?. Method getAll should rely on calling method getSum from part A. Show transcribed image text A) Write a method getSum that takes a four digit number and returns the square of the sum of the first two digits and the last two digits. For example that call getSum(1011) would return (10+11)? B) Write a method getAll which finds and prints all four digit numbers for which the square of the sum of the first two digits and the last two digits equal the number itself. For example, 3025 = (30 + 25)?. Method getAll should rely on calling method getSum from part A.
Expert Answer
Answer to A) Write a method getSum that takes a four digit number and returns the square of the sum of the first two digits and th…
Write Method Recursive Char Aa Char Bb Class Chart Returns String Starting Aa Concatenatin Q43785617
Write a methodrecursive(char aa, char bb) of a class Chart which returns a stringstarting from aa, concatenating with characters having values aa+1,aa+2, … and ending with bb using recursion,where aa <= bb. For example, the call aChart.recursive(‘b’, ‘e’)returns the string:
bcde
where aChart is an object of the classChart.
Expert Answer
Answer to Write a method recursive(char aa, char bb) of a class Chart which returns a string starting from aa, concatenating with …
Write Negations Following Statements Determine True Given Statement Negation Vx E D Jy E Q43810076(1)
Discrete mathematics: write negations for each of the followingstatements
Write negations for each of the following statements. Determine which is true, the given statement or its negation. a. Vx e D, JY E E such that x + y = 1 b. 3x E D such that Vy E E, x + y = -Y c. Vx e D, Ðy E E such that xy > y Show transcribed image text Write negations for each of the following statements. Determine which is true, the given statement or its negation. a. Vx e D, JY E E such that x + y = 1 b. 3x E D such that Vy E E, x + y = -Y c. Vx e D, Ðy E E such that xy > y
Expert Answer
Answer to Discrete mathematics: write negations for each of the following statements …
Write Negations Following Statements Determine True Given Statement Negation Vx E D Jy E Q43810076
Discrete mathematics: write negations for each of the followingstatements
Write negations for each of the following statements. Determine which is true, the given statement or its negation. a. Vx e D, JY E E such that x + y = 1 b. 3x E D such that Vy E E, x + y = -Y c. Vx e D, Ðy E E such that xy > y Show transcribed image text Write negations for each of the following statements. Determine which is true, the given statement or its negation. a. Vx e D, JY E E such that x + y = 1 b. 3x E D such that Vy E E, x + y = -Y c. Vx e D, Ðy E E such that xy > y
Expert Answer
Answer to Discrete mathematics: write negations for each of the following statements …
Write New Subroutine Assembly Convert Upper Case Letters Lower Case Letter Example Lower C Q43799696
Write a new subroutine in assembly to convert the upper-caseletters to lower-case letter. Example of lower case to upper isprovided below:
Let’s look at a subroutine to capitalize all the lower-caseletters in the string. We need to load each character, check to seeif it is a letter, and if so, capitalize it.
Each character in the string is represented with its ASCII code.For example, ‘A’ is represented with a 65 (0x41), ‘B’ with 66(0x42), and so on up to ‘Z’ which uses 90 (0x5a). The lower caseletters start at ‘a’ (97, or 0x61) and end with ‘z’ (122, or 0x7a).We can convert a lower case letter to an upper case letter bysubtracting 32.
__asm void my_strcpy(const char *src, char *dst){ loop LDRB r2, [r0] ; Load byte into r2 from mem. pointed to by r0 (src pointer) ADDS r0, #1 ; Increment src pointer STRB r2, [r1] ; Store byte in r2 into memory pointed to by (dst pointer) ADDS r1, #1 ; Increment dst pointer CMP r2, #0 ; Was the byte 0? BNE loop ; If not, repeat the loop BX lr ; Else return from subroutine} __asm void my_capitalize(char *str){ cap_loop LDRB r1, [r0] ; Load byte into r1 from memory pointed to by r0 (str pointer) CMP r1, #’a’-1 ; compare it with the character before ‘a’ BLS cap_skip ; If byte is lower or same, then skip this byte CMP r1, #’z’ ; Compare it with the ‘z’ character BHI cap_skip ; If it is higher, then skip this byte SUBS r1,#32 ; Else subtract out difference to capitalize it STRB r1, [r0] ; Store the capitalized byte back in memorycap_skip ADDS r0, r0, #1 ; Increment str pointer CMP r1, #0 ; Was the byte 0? BNE cap_loop ; If not, repeat the loop BX lr ; Else return from subroutine} /*—————————————————————————- MAIN function *—————————————————————————-*/int main(void){const char a[] = “Hello world!”;char b[20];my_strcpy(a, b);my_capitalize(b);while (1);}
Expert Answer
Answer to Write a new subroutine in assembly to convert the upper-case letters to lower-case letter. Example of lower case to uppe…
Write Output Execution C Codes Include Int F Int Int B 9 12 6 7 C Int Main O 9 47 B 52 Int Q43842713
DEV C++ ??
Write the output after execution of the C codes below: #include<stdio.h> : int f(int a,, int *b); 9-12, 6-7,c int main() o 9=47, b=52 int a-3, b=7,, (=4; (=f(b,&a) +3; q=23, b = 47, printf(“a=%d, b=%d, c=%dn”, a,b,c); b=f(a,&c); printf(“a=%d, b=%d,C=%dn”, a,b,c); return; int f(int a, int *b) *b)=(a*3)*2 +(*b)%41; a=*b-a%6; printf(“a=%dı, b=%dn”, a, *b); returm 2*a-*b); Show transcribed image text Write the output after execution of the C codes below: #include : int f(int a,, int *b); 9-12, 6-7,c int main() o 9=47, b=52 int a-3, b=7,, (=4; (=f(b,&a) +3; q=23, b = 47, printf(“a=%d, b=%d, c=%dn”, a,b,c); b=f(a,&c); printf(“a=%d, b=%d,C=%dn”, a,b,c); return; int f(int a, int *b) *b)=(a*3)*2 +(*b)%41; a=*b-a%6; printf(“a=%dı, b=%dn”, a, *b); returm 2*a-*b);
Expert Answer
Answer to Write the output after execution of the C codes below: #include : int f(int a,, int *b); 9-12, 6-7,c int main() o 9=47, …
Write Output Execution C Codes Include Int Fung Int Int Main Int N Counts Count 1 Count Q43842704
DEV C++??

a) Write the output after execution of the C codes below: #include<stdio.h> int fung (int); int main int n, counts for (count = 1; count <= 5; count++){ n = func (func(count)-count)+ func(count-1); printf(“%d”, n); return ; int func(int z) if (z!=0) return 24 func(2-1); else return 2; Write a program based on following pseudocode 1. START 2. g=9.81 3. u=20 4. while uc=50 t=10 while t<=50 pou sin (2/8) tu=t+1 display end, while Usu+1 end while 5. u=480 6. while uc=500 t=10 while tc-50 pay sin (2/8) t=t41 if reus display else display pl endi if end while UU:1 end, while 7). END Show transcribed image text a) Write the output after execution of the C codes below: #include int fung (int); int main int n, counts for (count = 1; count
Expert Answer
Answer to a) Write the output after execution of the C codes below: #include int fung (int); int main int n, counts for (count = 1…