Assignment Chef icon Assignment Chef

Browse assignments

Assignment catalog

33,401 assignments available

[SOLVED] Global health Assignment 2

Assignment 2: 1500-word Research Plan How to approach this research plan: The research plan seeks to assess your ability to synthesise existing literature, understand where gaps exist in knowledge, formulate research questions that are feasible and researchable, and develop a plan for how you will answer those questions. What should you include? 1. Title: Provide a brief, descriptive title. 2. Introduction: Describe your topic briefly, list the aims and objectives of your research and summarise what you would like to do. 3. Rationale and significance of the research: Explain why the topic is interesting and important. This should include a review of the academic literature and any relevant background information needed for readers to understand why your general topic and your research aims and objectives are original and worthy of study. 4. Research Questions: identify your questions 5. Research design and feasibility: data and methodology Describe the general approach you would like to take and explain how you will meet the aims and objectives of your dissertation. Provide details of the research methods you envisage using – how, in practice, will you carry out your research? At this stage we are looking to see that you have a feasible suggestion for a method, that you can realistically accomplish your research in the timescale of your dissertation, and that the method will address the questions you are posing. We do not expect you to have a detailed grasp of methodological literature, and we will expect your methodology to be refined after you have taken the various research modules on your degree programme. 6. Ethics and safety: Discuss any ethical issues and safety concerns that might be expected to arise, and how you plan to address these. If you don’t see any ethics or safety issues you can state that (e.g. if you are conducting desk-based research with publicly available sources). 7. Reference list: All references cited in the proposal should be detailed in the reference list. The reference list does not count towards the 1500-word limit. What will criteria will you be marked on? The research plan will be marked on the presentation of a coherent and compelling research proposal along the following lines: · Interesting, appropriate topic · Informative, relevant background section · Good, feasible aims and objectives · Sensible and justifiable research strategy · Appropriate design and methods · Coherent structure and clarity of proposal · A well-written proposal, with good balance between the various elements · Correct use of references

$25.00 View

[SOLVED] CAVA1001 Visual Art Foundation 1-S1 2025

CAVA1001: Visual Art Foundation 1 - S1, 2025 Final Work Project Assessment Weighting: 50% Submission Deadline: by 13th June 2025, 23:59 hours Submission Format: PDF uploaded to the "Assignment" section of Canvas Submission Requirements: 1. Images: o 1-3 images of your final project. o These can include different views of the same artwork (e.g., two detail images and one overall image) or a single key image. o Each image should have a caption with your name, title of the work, materials used, and dimensions of the work. 2. Theme Statement (200 words): o Idea/Concept: Explain the main idea or concept your work seeks to communicate, referring to the Theme you developed in Week 12. o Materials and Processes: Describe the materials and processes you used to create the work, including its dimensions. o Optional Points: What you see as successful in the work. What you learned through your presentation and feedback. Aspects you would like to develop in the future. Acknowledgement of any artistic influences that informed your work. Artistic Expression: Choose a mode of artistic expression from the methodologies explored this semester, such as: o Ceramics o Sculpture/Assemblage o Collage/Painting (this work must show a balance of 50% collage and 50% painting) o Digital Print o Automatic Drawing o Experimental Field Recording Your choice of methodology may be influenced by the individual theme you develop in Week 12. Creativity and Experimentation: There is ample scope for creativity and experimentation in this project. You are encouraged to be innovative and explore new ideas.

$25.00 View

[SOLVED] STAT 2450 Recitation Activity 3

STAT 2450 Recitation Activity #3 Numerical Summary Measures OBJECTIVES •   Students will compute measures of central tendency and variability. •   Students will understand the connection between graphical displays & numerical summaries. •    Students will identify statistics that are resistant to outliers through exploration. Measures of Central Tendency and Variability for a Sample vs. Population: The measures of central tendency discussed here (sample statistics) have corresponding measures in the population (population parameters).  One goal of this course is to use sample statistics to estimate population parameters. Measure Sample Statistic Population Parameter   x μ   x μ   tr(p) ---   M ---   ^(p) p   2 s 2 σ   s σ PART I: VOCABULARY    Complete the sentence. 1.   [1 point]              skewed data has a sample mean that is larger than its median. 2.   [1 point] What are the 3 primary ‘calculations’ used in describing the center of a data set? Briefly define each of them. PART II: DATA ANALYSIS 3.   The perceived stress levels of 30 employees are listed below. 55                35               43               40               46                58 12                37                40                32                46                48 39                74                43                52                35                29 28                43                34                  3                63                29 71                62                30                60                61                27 a.   [2 points] Create a frequency distribution of the data. Class Frequency Relative frequency Cumulative rel. freq.(CRF)                                                                         b.   [2 points] Sketch a relative frequency histogram based upon the frequency distribution in part(a). c.   [1 point] Describe the center of the data. d.   [2 points] Enter the data into R. Title the column Stress. Compare this histogram to the one created earlier. Create a histogram by using the following code in R: Open a excel file and input data under the column name “Stress” .  Save the data set in .csv format (Stress.csv). Click the “import dataset” button on the environment pane. Click the “From Text(base)” option in the import dataset menu and select your dataset file. Type “Stressdata” on Name field. Click “import” . Or Run the following code: #download the Stress data set from Carmen site # use file.choose("stress.csv") to locate the place you saved the dataset and copy and paste that place inside the read.csv() function stressdata=read.csv("/Users/sanjeewaniweerasingha/Library/CloudStorage/OneDrive- TheOhioStateUniversity/OSUteaching/AAASTAT 2450/Summer 2025/Week 01 and 2/recitation/Rec 2/stressdata.csv") Copy and paste the created histogram here. hist(stressdata$Stress, main="Frequency Distribution of Stress data", xlab="class", ylab="Frequency") PART III: Understanding visualization options in R 4.   Let’s start with the States data in the library carData This data set contains information regarding each state’s (and the District of Columbia’s) population, verbal and math SAT scores, proportion of high school students taking the SAT, dollars ($1000) in state public education spending, and average teacher salary ($1000) in 1992. Step I: Install the carData package by using the code install.packages(“carData”) Package installation you have to do onetime, and then you may comment the above code with # symbol as follows #install. Packages(“carData”) Step II: Keep open the carData library in your working environment with the following code library(carData); you are not supposed to comment this code Step III: Import the States data set by using the code data(State) Step IV: Look at the details of the data set either by using View(State) or head(State) code. (a). [1 point] Use the code ?States() to get the description of States data set on Help pane. What is the real meaning of dollar variable in this dataset. (b). [3 points] Use the code class(States$pop) to determine the format in which R has stored this variable. Then, find the variable type/format for the following variables and state whether these variables are categorical, numerical discrete, or numerical continuous type variables. Region: Percent: Dollars: (c) [3 points] Draw the histogram and make modifications using the following code for the SATV variable. Don't forget to label the x-axis and y-axis, and to add a title to the histogram. Arrange all these histograms in a grid of (1,3). par(mfrow = c(1, 3))  # 1 rows, 3 columns hist(States$SATV) #You may change the default class with by using break option inside hist function hist(States$SATV, breaks=10) # Or you may control more the starting and ending points in x axis by using hist(States$SATV,  breaks = seq(300, 600, by = 25)) # Here we used the seq() function to create a sequence of values from 300 to 600, # increasing by 25. Run seq(300, 600, by = 25) to see the generated sequence. (d). [3 points] Run the following code to create a pie chart of the region variable and paste it here. pie(table(States$region)) If you want to  include the calculated percentages in your plot, please follow the following code region_counts

$25.00 View

[SOLVED] Cse3666 homework 4

1. Design a circuit that takes 4 bits as input and outputs F, which is 1 only when the 4-bit input, interpreted as an unsigned number, is positive and divisible by 3. The input signals are A, B, C, and D. D is the least significant bit. We can start a truth table like the one below and then write a logic equation for F. We do not simplify the logic expression in this problem. Row no. A B C D F 0 0 0 0 0 1 1 0 0 0 1 0 2 0 0 1 0 0 3 0 0 1 1 1 … Implement the circuit in MyHDL. The skeleton code is in q1.py. Compare the truth table generated by the script with the one constructed manually. The PDF file needs to include comb() function only. CSE3666 2. We build a state machine that detects if a binary number of an arbitrary length is divisible by 3. The state machine has three states S0, S1, and S2. The bits in the number are fed into the machine from left to right, i.e., from the most to the least significant bit, one bit per clock cycle. The state machine starts from S0. Depending on the current state and the input bit, the state machine transits from one state to another, as shown in the following diagram. The numbers in the state names (S0, S1, and S2) are the remainder when we divide by 3 the bits that the machine has seen. If the state is S0, the bits are divisible by 3. Implement the state machine in MyHDL. The skeleton code is in hw4q2.py. We can complete the design in 3 steps. Steps 2 and 3 are combinational circuit. Step 1. Instantiate a register to keep the state. We leverage the Register block that is provided in the skeleton code. The input and output signals of the state register have already been created. You can find an example of instantiating a Register in shift_register.py on the following page. cse3666/shift-regsiter.py at master · zhijieshi/cse3666 (github.com) Step 2. Complete the next_state_logic() function, which generates the state to be saved in the state register in the next cycle. Step 3. Complete the z_logic() function, which generates the output signal z, which indicates whether the number is divisible by 3. The z signal only depends on the current state. In the PDF file, list your code for each step. In addition, show the output of the program when eight random bits you choose are sent to the machine. We can specify bits on the command line. Here is an example where the bit string is 110111. python hw4q4.py 110111 b | z v 1 | 0 1 # the first bit is the MSB, which is 1 1 | 1 3 # two left most bits 11. It is divisible by 3 0 | 1 6 # now the machine sees three bits 110 1 | 0 13 # and so on 1 | 1 27 1 | 0 55 # all 6 bits are fed to the state machine CSE3666 Although it is not required, you are encouraged to generate the trace file and observe the waveforms of signals. 3. Consider the multiplier we have studied. If the delay of the adder is 10 ns, the setup time, the hold time, and the propagation delay of the registers is 0.2 ns, 0.25 ns, and 0.3 ns, respectively. When entering answers in HuskyCT, round answers to the nearest tenth if necessary. For example, enter 3 for 3, 0.3 for 1/3, and 0.7 for 2/3. Keep the 0 before the decimal point. a. What is the minimum cycle time for this multiplier to work properly? b. What is the highest clock rate that this multiplier can run at? c. If we build a sequential circuit with the same kind of registers and want the circuit run at 1 GHz, what is the maximum delay of the combinational module? d. If we build sequential circuit with the same kind of registers, what is the highest clock rate we can achieve? 4. Assume we have built a 5-bit multiplier, based on the design we have discussed, and use it to calculate 27 * 17. Fill out the following table with bits stored in registers after each step. Steps Multiplicand Multiplier Product init 1 2 3 4 5 CSE3666 5. Translate the following C function to RISC-V assembly code. The function converts an unsigned number into a string that represents the number in decimal. For example, after the following function call, the string placed in buffer is “3666”. uint2decstr(buffer, 3666); Assume the caller has allocated enough space for the string. Skeleton code is in q5.s, where the function is empty. Clearly mark in comments how each statement is translated into instructions. The PDF file needs to include the instructions in the function only. char * uint2decstr(char *s, unsigned int v) { unsigned int r; if (v >= 10) { s = uint2decstr(s, v / 10); } r = v % 10; // remainder s[0] = ‘0’ + r; s[1] = 0; return &s[1]; // return the address of s[1] }

$25.00 View

[SOLVED] Cse3666 homework 3

1. Encoding. For each RISC-V instruction, find out its encoding format, the bits in each field, and the machine code as 8 hexadecimal digits. An example is shown below. Pay attention to the number of bits in each field. or s1, s2, s3 slli t1, t2, 16 xori x1, x1, -1 lw x2, -100(x3) Example: Instruction: addi t0, t1, 3 Find out register numbers: addi x5,x6,3 I-type Immediate: 000000000011 opcode: 0010011 rd: 00101 funct3: 000 rs1: 00110 rs2: 00011 funct7: 0000000 machine code in bits: 00000000001100110000001010010011 machine code in hex: 00330293 CSE3666 2. Decoding. Each 8-digit hexadecimal number in the following table represents a RISC-V instruction. For each machine code, find its encoding format, bits in each field, and then decode it into a RISC-V instruction. The steps are the reverse of those in Problem 1. Use register numbers (like x0 instead of zero). Any immediate or displacement (offset) should be in decimal. When entering instructions in HW3-test, keep only one space after instruction name. For example, there is only one space in “lw x2,-100(x3)”. There is no space after the comma and around the parentheses. Machine Code a 0xfeaca823 b 0x04020713 c 0x00557bb3 d 0x414fdf13 3. Find the machine code for the following instruction. Assume all instructions are labeled sequentially, for example, I1, I2, I3, …, I200. I10 : BGE x10, x20, I100 I11 : BEQ x10, x0, I1 4. Decode the following instructions in machine code. Find the offset and then the target address. The hexadecimal number before the colon is the instruction’s address. 0x0400_366C: 0xDB5A_04E3 CSE3666 5. Translate function f() in the following C code to RISC-V assembly code. Assume function g has already been implemented. The constraints are: 1) Allocate register s1 to sum, and register s2 to i. 2) Save registers at the beginning of the function and restore them before the exit. 3) There are no load or store instructions in the loop. If we want to preserve values across function calls, place the value in a saved register before the loop. For example, we keep variable i in register s2. Your code should follow the flow of the C code. Write concise comments. Clearly mark instructions for saving registers, loop control, function, restoring register, and so on. Reminder: the callee can change any temporary and argument registers. // prototype of g // the first argument of g is an address of an integer int g(int * a, int i); int f(int d[1024]) { int sum = 0; for (int i = 0; i < 1024; i += 1) { sum += g(&d[i], i); // pass d[i]’s address to g } return sum; } CSE3666 6. Translate function msort() in the following C code to RISC-V assembly code. Assume merge() and copy() are already implemented. The array passed to msort() has at most 256 elements. Your code should follow the flow of the C code. Write concise comments. Clearly mark instructions for saving registers, function calls, restoring register, and so on. To make the code easier to read, we can change sp twice at the beginning of the function: once for saving registers and once for allocating memory for array c. The function should have only one exit. There is only one return instruction. Another reminder: the callees can change any temporary and argument registers. void merge(int c[], int d1[], int n1, int d2[], int n2); void copy(int d[], int c[], int n); void msort(int d[], int n) { int c[256]; if (n

$25.00 View

[SOLVED] Cse3666 homework 2

1. Suppose A and B are word arrays. The following C loop increments elements in A by 4 and saves the results into B. for (i = 0; i < 100; i += 1) B[i] = A[i] + 4; The following table shows the mapping between variables and registers. Register s1 s2 s3 Variable/value i Address of A Address of B We will study two implementations in RISC-V. a) The first implementation is based on the array copy code we discussed in lecture. We just need to revise it slightly. What changes do we need? How many instructions will be executed for the loop? Note that we do not need to jump to the condition test before the first iteration because we are sure the condition is true at the beginning. b) Loop unrolling is an optimization technique to improve the performance of programs. In the second implementation, we unroll the loop and process four array elements in A in each iteration. The unrolled loop in C is shown below. Translate the loop to RISC-V instructions. Try to minimize the number of instructions that are executed. Explain your code. How many instructions will be executed for the new loop? for (i = 0; i < 100; i += 4) { B[i] = A[i] + 4; B[i+1] = A[i+1] + 4; B[i+2] = A[i+2] + 4; B[i+3] = A[i+3] + 4; } CSE3666 2. A two-dimensional array in C (and some other languages) can be considered as an array of one-dimensional array. For example, the following define T as an 16×8 array in C. int T[16][8]; The two-dimensional array can be considered as an array of 16 elements, each of which is a one-dimensional array of 8 integers/words. The words are stored in memory in the following order: T[0][0], T[0][1], …, T[0][6], T[0][7], T[1][0], T[1][1], …, T[1][6], T[1][7], … T[14][0], T[14][1], …, T[14][6], T[14][7], T[15][0], T[15][1], …, T[15][6], T[15][7] Row 0, consisting of T[0][0], T[0][1],…, and T[0][7], goes first. Row i is stored right after row i – 1, for i = 1, 2, …, 15. For example, T[1][0] is stored right after T[0][7]. If T[0][0] is located at address 1000, T[0][7] is located at address 1028 = 1000 + 7 * 4. And T[1][0] is located at address 1032. Similarly, we can calculate that T[2][0] is located at 1064, T[3][0] is located at 1096, and so on. Translate the following C code to RISC-V instructions. Assume T’s address is already in s9. As a practice of accessing two-dimensional arrays, do not use pointers. Explain your code, especially how you implement the loops and how you calculate T[i][j]’s address. for (i = 0; i < 16; i += 1) for (j = 0; j < 8; j += 1) T[i][j] = 256 * i + j;

$25.00 View

[SOLVED] Cse3666 homework 1

1. For each of the 10-bit numbers specified by hexadecimal digits below, write down 1) the 10 bits in the number, 2) its value in decimal when the bits are interpreted as 10-bit unsigned binary numbers, and 3) its value in decimal when the bits are interpreted as 10-bit two’s complement numbers. a. 0x 1AB b. 0x 2CD 2. Convert the following decimal numbers to 8-bit 2’s complement numbers, and then represent 8 bits with two hexadecimal digits. a. 97 b. ‐100 3. For each instruction in the table, write 8 hexadecimal digits that represent the 32 bits in the destination register after the instruction is executed. Assume s0 is 0x98AB3C6A, s1 is 0x20503666. Instructions Dest. reg. in 8 hexadecimal digits add t0, s0, s1 and t1, s0, s1 or t2, s0, s1 xor t3, s0, s1 addi t4, s0, 0x210 andi t5, s0, ‐16 slli t6, s0, 12 srai s2, s0, 84. Suppose a value x is in register s1. Use a minimum number of RISC-V instructions to compute 24x (i.e., the product of 24 and x) and save the result in register s2. The instructions are shift, ADD, or SUB instructions. You do not need to use all of them. Assume the result has only 32 bits so it can be saved in a register without overflow. Explain your method. Note that a naïve method is to use 24 ADD instructions. It works, but apparently, it is not the correct answer. 5. The following RISC-V instructions calculate the Hamming weight (the number of 1’s) of s0. The result is saved in register s1. addi s1, x0, 0 # s1 = 0 addi t0, x0, 1 # Use t0 as mask to test each bit in s0 loop: and t1, s0, t0 # extract a bit with the mask beq t1, x0, skip # if the bit is 0, do not increment s1 addi s1, s1, 1 # increment the counter skip: slli t0, t0, 1 # shift mask to left by 1 bne t0, x0, loop # if the mask is not 0, continue a. If s0 is 0xFF00FF00, how many instructions are executed? Does the number of executed instructions depend on the number of 1’s in s0? Does it depend on the location of 1’s? Explain your answers. b. There are many ways to compute Hamming weight. We could test the most significant bit (bit 31) of s0. For example, extract bit 31 with an AND instruction, and compare it with 0. This is similar to the method in the code given. However, we can save one instruction. If we treat s0 as a 2’s complement number, s0 is less than 0 if and only if bit 31 in s0 is 1. Using this method, write RISC-V instructions to compute the Hamming weight of s0. Explain your method in comments. We can start with the following two instructions. How many instructions are executed if s0 is 0xFF00FF00? addi s1, x0, 0 # s1 = 0 add t0, x0, s0 # make a copy so s0 is not changed6. Translate the following C code to RISC-V assembly code. Use a minimum number of instructions. Assume that the values of a, i, j, and r are in registers s1, s2, s3, and s4, respectively. All the variables are signed. Load the constant into register s5 before the loop. Write brief comments in your code. Clearly mark the instructions that controlling the outer loop and the inner loop (for example, using different colors). There are 12 instructions in the solutions. for (i = 1; i < a; i++) for (j = 0; j < i; j++) r ^= (j + 0x55AABB33);

$25.00 View

[SOLVED] Csce 240 – programming assignments one to five solution

Program Purpose – Convert numeric values expressed in bases between 2 and 9, inclusive, to the base 10 equivalents of those values. The program will output the base 10 values, the number of values input, and the largest value input. Overview In a positional numeration system with base b, each position represents a power of b. In the decimal system, which is a positional numeration system with base 10, each position represents a power of 10. So, for example, the decimal number 4809 is 4 · 103 + 8 · 102 + 0 · 101 + 9 · 100. Similarly, in binary, which is a positional numeration system with base 2, each position represents a power of 2. For example, the binary number 11001 is 1 · 24 + 1 · 23 + 0 · 22 + 0 · 21 + 1 · 20. So, the value 11001 in binary would be expressed as 25 in decimal. For more detail and examples about positional numeration systems, read over the “Numeration Systems” PDF. Program Details For each numeric value, the user will enter two integers from the standard input device (use cin). The first integer is a numeric value, and the second integer is the base in which that number is expressed. Your program should check each base input to ensure that it is between 2 and 9, inclusive. If the base is outside of this accepted range, your program should output “Base Not Accepted” to the standard output device (using cout), and the program should end. Your program should also check each numeric value input to ensure that it only contains valid digits for the given base. The number of unique digits in a positional numeration system is equal to the base. In base 10, for example, the valid digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9. The binary numeration system, on the other hand, only uses the unique digits 0 and 1. If the numeric value input uses invalid digits, your program should output “Invalid Digit(s) in Number” to the standard output device (using cout), and the program should end. If the input numeric value and base are valid, the program should output the number expressed in decimal (base 10) to the standard output device (using cout) Following each numeric value entered, the user will input the character ‘y’ if another numeric value will be input, or ‘n’ if no more numeric values will be input. When the user enters ‘n’ the program should output the number of values input and the largest value input (expressed in decimal) in the following format: Of the num values input, the which value entered (decimalvalue) was the largest Where num is the number of values input, which is the position of that value (e.g. “1st”, “2nd”, “3rd”, etc), and decimal is the base 10 equivalent of that value. Example Input/Output Pairs Example Input Example Output 1101 1 n Base Not AcceptedExample Input Example Output 1030 3 n Invalid Digit(s) in Number Example Input Example Output 1101 2 y 13 1101 3 y 37 320 4 y 56 43 5 y 23 11000 2 n 24 Of the 6 values input, the 3rd value entered (56) was the largest Input Assumptions Assume that the user input will match the expected format. i.e. The user will input integer values, as described above, for the numeric value and base. If the user enters non-integer values, it is ok (expected) for your program to crash. The user will input a single character (y or n as described above) to signify whether or not another numeric value will be input. If the user enters more than one character, it is ok (expected) for your program to crash. Additional Specifications – All output should be directed to the standard output device using cout. – All input should be accepted from the standard input device using cin. – The final output in every execution of your program must be an endl. – Do not prompt for input. – All of your source code for the program must be contained in a single file named program1.cc – Submit your program1.cc file to the assignment in Blackboard. – The only header file that can be included in your code is iostream. Programs that include other headers will not be eligible for correctness points. – Programs must compile and run on a computer of the instructor’s choosing in the Linux lab (see your course syllabus for additional details). – Be sure to review the program expectations section of the course syllabus. Initial Testing Initial tests for the functions are attached to the assignment in Blackboard. A makefile has been included to run your functions with the sample tests. To use the makefile, ensure that your program1.cc file and all of the files attached to the assignment are in the same directory. Your program will be graded using this same method with additional tests. The commands to run the sample tests are given below: make test1 make test2 make test3 make test4 make test5 make test6 You are strongly encouraged to create additional, more rigorous tests. The six included tests and one new test will be used to grade your program. Grade Breakdown Style: 1 point Documentation: 1 point Clean compile/link of program1.cc: 1 point Runs correctly with instructor’s test input 1: 1 point Runs correctly with instructor’s test input 2: 1 point Runs correctly with instructor’s test input 3: 1 point Runs correctly with instructor’s test input 4: 1 point Runs correctly with instructor’s test input 5: 1 point Runs correctly with instructor’s test input 6: 1 point Runs correctly with instructor’s test input 7: 1 point The penalty for late assignment submissions is 10% per day up to three days after the assignment due date. No assignment submissions will be accepted more than 3 days after the due date.Program Purpose – Implement the functions described below IsSquare – Function that takes an integer argument and returns whether or not the argument is a perfect square (is equal to an integer squared). For example, IsSquare(4) should return true, and IsSquare(5) should return false. IsPerfect – Function that takes an integer argument and returns whether or not the argument is a perfect number. A perfect number is a positive integer that is equal to the sum of all of its proper divisors. For example, IsPerfect(6) should return true, because the proper divisors of 6 are 1, 2, and 3, and 1 + 2 + 3 = 6. IsPerfect(12) should return false, because the proper divisors of 12 are 1, 2, 3, 4, and 6, and 1 + 2 + 3 + 4 + 6 is not equal to 12. IsVowel – Function that takes a character and a bool as arguments. If the character argument is a vowel, the function should return true. If the character argument is not a vowel, the function should return false. The bool argument determines whether (true) or not (false) the letter y should be considered a vowel. The bool parameter should have a default value of true. For example, IsVowel(‘y’, false) should return false. IsVowel(‘y’) should return true. IsVowel(‘E’) should return true. IsVowel(‘X’) should return false. IsVowel(‘u’, false) should return true. IsConsonant – Function that takes a character and a bool as arguments. If the character argument is a consonant, the function should return true. If the character argument is not a consonant, the function should return false. The bool argument determines whether (true) or not (false) the letter y should be considered a consonant. The bool parameter should have a default value of true. For example, IsConsonant(‘y’, false) should return false. IsConsonant(‘y’) should return true. IsConsonant(‘E’) should return false. IsConsonant(‘X’) should return true. IsConsonant(‘g’, false) should return true. ToDigit – Function that takes a character argument and returns the integer equivalent of that argument if the argument is ‘0’, ‘1’, ‘2’, ‘3’, ‘4’, ‘5’, ‘6’, ‘7’, ‘8’, or ‘9’. If the argument is not a digit character, the function should return 0. Range – Function that takes two integer variables as arguments and returns the distance between the variable’s values. Once the function call is complete, the variable sent for the first argument should hold the smaller of the two values, and the variable send for the second argument should hold the larger of the two value. For example, if x = 3 and y = 7, Range(x, y) should return 4. And after the function call is complete, x will still hold 3, and y will still hold 7. If a = 9 and b = 1, Range(a, b) should return 8. And after the function call is complete, a should hold 1, and b should hold 9. DigitInPosition – Function that takes a double and an integer as its two arguments. The integer argument is the position of the digit in the double to be returned. The position is relative to the digit in the ones place, which is position 0. So, position -1 is 1 position to the left of the ones place, i.e. the tens place. And position 2 is 2 positions to the right of the ones place, which is the hundredths place. For example, DigitInPosition(185.34, 0) should return 5 since the 5 is zero positions away from the ones place. DigitInPosition(185.34, -2) should return 1 since the 1 is two positions to the left of the ones place. DigitInPosition(185.34, 1) should return 3 since the 3 is one position to the right of the ones place. Additional Specifications – All function prototypes must be contained in a file named program2functions.h – All function implementations must be written in a file named program2functions.cc – You will submit your program2functions.h and program2functions.cc files to the assignment in Blackboard. – Programs must compile and run on a computer of the instructor’s choosing in the Linux lab (see your course syllabus for additional details). – Be sure to review the program expectations section of the course syllabus. Initial Testing Initial tests for the functions are attached to the assignment in Blackboard. A makefile has been included to run your functions with the sample tests. To use the makefile, ensure that your program2functions.h and program2functions.cc files and all of the files attached to the assignment are in the same directory. Your program will be graded using this same method with modified tests. The commands to run the sample tests are given below: make testIsSquare make testIsPerfect make testIsVowel make testIsConsonant make testToDigit make testRange make testDigitInPosition You are strongly encouraged to create additional, more rigorous tests. Grade Breakdown Style: 1 point Documentation: 1 point Clean compile/link of program2functions.cc: 1 point IsSquare passes instructor’s tests: 1 point IsPerfect passes instructor’s tests: 1 point IsVowel passes instructor’s tests: 1 point IsConsonant passes instructor’s tests: 1 point ToDigit passes instructor’s tests: 1 point Range passes instructor’s tests: 1 point IsSquare passes instructor’s tests: 1 point The penalty for late assignment submissions is 10% per day up to three days after the assignment due date. No assignment submissions will be accepted more than 3 days after the due date.Purpose Write, test, and use the four functions described below to read a text file containing a word search grid, display the grid, and find words within the grid. Functions Function 1 – ReadWordSearch Implement the ReadWordSearch function. This function reads a text file containing the characters into a double-subscripted character array with kSize rows and kSize columns. kSize is a constant variable set in word_search_functions.h. This function should return true if the character array is successfully populated, and false if not. Read over the pre-condition and post-condition comments in word_search_functions.h for more details. Function 2 – PrintWordSearch Implement the PrintWordSearch function. This function takes a doublesubscripted character array with kSize rows and kSize columns as an argument and outputs the characters at the standard output device (using cout) in a grid with a space between each column. Read over the pre-condition and postcondition comments in word_search_functions.h for more details. Function 3 – FindWordRight Implement the FindWordRight function. This function takes a double-subscripted character array with kSize rows and kSize columns, a string, and two integer references as arguments. The function will locate the first occurrence of the string in the array, written from left to right in a row in the array, and set the integer reference arguments to the starting position of the string. If the string appears in a row of the character array, the function returns true. If the string does not appear in a row in the array, the function returns false. Read over the pre-condition and post-condition comments in word_search_functions.h for more details. Function 4 – FindWordLeft Implement the FindWordLeft function. This function takes a double-subscripted character array with kSize rows and kSize columns, a string, and two integer references as arguments. The function will locate the first occurrence of the string in the array, written from right to left in a row in the array, and set the integer reference arguments to the starting position of the string. If the string appears in a row of the character array, the function returns true. If the string does not appear in a row in the array, the function returns false. Read over the pre-condition and post-condition comments in word_search_functions.h for more details. Function 5 – FindWordDown Implement the FindWordDown function. This function takes a double-subscripted character array with kSize rows and kSize columns, a string, and two integer references as arguments. The function will locate the first occurrence of the string in the array, written down in a column in the array, and set the integer reference arguments to the starting position of the string. If the string appears in a column of the character array, the function returns true. If the string does not appear in a column in the array, the function returns false. Read over the pre-condition and post-condition comments in word_search_functions.h for more details. Function 6 – FindWordUp Implement the FindWordUp function. This function takes a double-subscripted character array with kSize rows and kSize columns, a string, and two integer references as arguments. The function will locate the first occurrence of the string in the array, written up (from bottom to top) in a column in the array, and set the integer reference arguments to the starting position of the string. If the string appears in a column of the character array, the function returns true. If the string does not appear in a column in the array, the function returns false. Read over the pre-condition and post-condition comments in word_search_functions.h for more details. Function 7 – FindWordDiagonal Implement the FindWordDiagonal function. This function takes a doublesubscripted character array with kSize rows and kSize columns, a string, and two integer references as arguments. The function will locate the first occurrence of the string in the array, written diagonally from left to right in the array, and set the integer reference arguments to the starting position of the string. If the string appears on a diagonal in the character array, the function returns true. If the string does not appear on a diagonal in the array, the function returns false. Read over the pre-condition and postcondition comments in word_search_functions.h for more details. Example For the grid below: e c n e i c t p r o g r a m r g m a u z u c l m n o n a e b i a c w s i g r x t t v s t l t n y y u a r e o b x i e i o r b r h b k t m n w h a l w l b e a l s c a w e c n e i c s p r o g r a m q x z FindWordRight should find “program” at position 9,0 FindWordLeft should find “science” at position 8,9 FindWordDown should find “guitar” at position 1,0 FindWordUp should find “meeting” at position 9,6 FindWordDiagonal should find “nine” at position 2,4 Specifications – All output should be directed to the standard output device using cout. – The prototypes for the FindWordRight, FindWordLeft, FindWordDown, FindWordUp, and FindWordDiagonal functions are included in word_search_functions.h. Do not change the contents of the header file, except to modify the constant kSize, when testing your functions for different size word search grids. You must implement these functions in word_search_functions.cc, and word_search_functions.cc must include word_search_functions.h – You will submit word_search_functions.cc to the assignment in Blackboard. – Source files must compile and run on a computer of the instructor’s choosing in the Linux lab (see your course syllabus for additional details). Testing A sample text file, grid.txt, containing the example word search grid shown above, a sample driver to test your functions program3.cc, and a makefile have been provided. You should ensure that your functions find the words in the positions provided in the examples. You should search for words that do not appear in the grid to ensure that the words are not found and your functions do not crash. You are encouraged to test your functions with additional grids and search words. Your functions will be graded using the included program3.cc with modifications to kSize and the grid.txt input file. Grade Breakdown Style: 1 point Documentation: 1 point Clean compilation: 1 point ReadWordSearch passes instructor’s tests: 1 point PrintWordSearch passes instructor’s tests: 1 point FindWordRight passes instructor’s tests: 1 point FindWordLeft passes instructor’s tests: 1 point FindWordDown passes instructor’s tests: 1 point FindWordUp passes instructor’s tests: 1 point FindWordDiagonal passes instructor’s tests: 1 point The penalty for late program submissions is 10% per day, with no program being accepted after 3 days.Purpose – Implement the following two classes Weight Create a Weight class that holds the value and units of a weight in private double and string data members, respectively. The class should allow for the units to be ounces, pounds, grams, or kilograms. The class will contain a constructor, a ConvertUnits member function, and accessor and mutator functions for the private data members. You will also need to overload the

$25.00 View

[SOLVED] Csce 240 – programming assignment one

Program Purpose – Convert numeric values expressed in bases between 2 and 9, inclusive, to the base 10 equivalents of those values. The program will output the base 10 values, the number of values input, and the largest value input. Overview In a positional numeration system with base b, each position represents a power of b. In the decimal system, which is a positional numeration system with base 10, each position represents a power of 10. So, for example, the decimal number 4809 is 4 · 103 + 8 · 102 + 0 · 101 + 9 · 100. Similarly, in binary, which is a positional numeration system with base 2, each position represents a power of 2. For example, the binary number 11001 is 1 · 24 + 1 · 23 + 0 · 22 + 0 · 21 + 1 · 20. So, the value 11001 in binary would be expressed as 25 in decimal. For more detail and examples about positional numeration systems, read over the “Numeration Systems” PDF. Program Details For each numeric value, the user will enter two integers from the standard input device (use cin). The first integer is a numeric value, and the second integer is the base in which that number is expressed. Your program should check each base input to ensure that it is between 2 and 9, inclusive. If the base is outside of this accepted range, your program should output “Base Not Accepted” to the standard output device (using cout), and the program should end. Your program should also check each numeric value input to ensure that it only contains valid digits for the given base. The number of unique digits in a positional numeration system is equal to the base. In base 10, for example, the valid digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9. The binary numeration system, on the other hand, only uses the unique digits 0 and 1. If the numeric value input uses invalid digits, your program should output “Invalid Digit(s) in Number” to the standard output device (using cout), and the program should end. If the input numeric value and base are valid, the program should output the number expressed in decimal (base 10) to the standard output device (using cout) Following each numeric value entered, the user will input the character ‘y’ if another numeric value will be input, or ‘n’ if no more numeric values will be input. When the user enters ‘n’ the program should output the number of values input and the largest value input (expressed in decimal) in the following format: Of the num values input, the which value entered (decimalvalue) was the largest Where num is the number of values input, which is the position of that value (e.g. “1st”, “2nd”, “3rd”, etc), and decimal is the base 10 equivalent of that value. Example Input/Output Pairs Example Input Example Output 1101 1 n Base Not AcceptedExample Input Example Output 1030 3 n Invalid Digit(s) in Number Example Input Example Output 1101 2 y 13 1101 3 y 37 320 4 y 56 43 5 y 23 11000 2 n 24 Of the 6 values input, the 3rd value entered (56) was the largest Input Assumptions Assume that the user input will match the expected format. i.e. The user will input integer values, as described above, for the numeric value and base. If the user enters non-integer values, it is ok (expected) for your program to crash. The user will input a single character (y or n as described above) to signify whether or not another numeric value will be input. If the user enters more than one character, it is ok (expected) for your program to crash. Additional Specifications – All output should be directed to the standard output device using cout. – All input should be accepted from the standard input device using cin. – The final output in every execution of your program must be an endl. – Do not prompt for input. – All of your source code for the program must be contained in a single file named program1.cc – Submit your program1.cc file to the assignment in Blackboard. – The only header file that can be included in your code is iostream. Programs that include other headers will not be eligible for correctness points. – Programs must compile and run on a computer of the instructor’s choosing in the Linux lab (see your course syllabus for additional details). – Be sure to review the program expectations section of the course syllabus. Initial Testing Initial tests for the functions are attached to the assignment in Blackboard. A makefile has been included to run your functions with the sample tests. To use the makefile, ensure that your program1.cc file and all of the files attached to the assignment are in the same directory. Your program will be graded using this same method with additional tests. The commands to run the sample tests are given below: make test1 make test2 make test3 make test4 make test5 make test6 You are strongly encouraged to create additional, more rigorous tests. The six included tests and one new test will be used to grade your program. Grade Breakdown Style: 1 point Documentation: 1 point Clean compile/link of program1.cc: 1 point Runs correctly with instructor’s test input 1: 1 point Runs correctly with instructor’s test input 2: 1 point Runs correctly with instructor’s test input 3: 1 point Runs correctly with instructor’s test input 4: 1 point Runs correctly with instructor’s test input 5: 1 point Runs correctly with instructor’s test input 6: 1 point Runs correctly with instructor’s test input 7: 1 point The penalty for late assignment submissions is 10% per day up to three days after the assignment due date. No assignment submissions will be accepted more than 3 days after the due date.

$25.00 View

[SOLVED] Csce 240 – programming assignment five

Project Purpose Implement the two classes described below. Both classes must be added to the csce240_programming_assignment_5 namespace. NOTE: The only standard library includes allowed for this project are: iostream and string. You must properly manage memory using pointers. SongRecording private data members: – a string for the song title – a pointer to dynamically allocated memory holding the artist name(s) (strings) – an integer to hold the number of artists (must always be greater than or equal to 1) – an integer to hold the length of the track in seconds (must always be nonnegative) public member functions: – A constructor that can take the title, primary artist, track length, and number of artists as its four parameters with default arguments of “untitled”, “unknown”, 0, and 1, respectively – A copy constructor – An overloaded assignment operator – A destructor – GetTitle() – Returns the title – SetTitle(string) – Sets the title to any string that is at least 1 character long – GetNumArtists() – Returns the number of artists – SetNumArtists(int) – Sets the number of artists to any positive integer. Manages memory for the string pointer data member. – SetArtist(string, int) – Sets the name of the artist if the string is at least one character in length, and the integer argument is valid (between 1 and the number of artists, inclusive). The int parameter should have a default argument of 1. – GetArtist(int) – This function should have a default argument of 1. It returns the name of the specified artist if the integer argument is between 1 and the number of artists, inclusive. If the integer argument is out of range, the function should return the string “out of bounds” – GetTrackLength() – Returns the track length – SetTrackLength(int) – Sets the value of the track length data member to the functions argument as long as the argument is non-negative. If the argument is negative the track length data member should remain unchanged. Initial testing of the SongRecording class Include your SongRecording.h and SongRecording.cc files in the same directory as all of the provided test files and makefile. Type the following commands for initial tests of the data members and functionality. make testTitle make testTrackLength make testArtist make testSoundRecordingConstructors1 make testSoundRecordingCopyConstructor make testSoundRecordingAssignment You are encouraged to create additional, more rigorous tests! StreamingTrack – This class must be derived via public inheritance from your SongRecording class private data members: – an integer holding the number of times the track has been streamed – a pointer to dynamically allocated memory holding the track’s genre(s) (strings) – an integer hold the number of genres (must be non-negative)) public member functions: – A constructor that can take the title, primary artist, track length, number of artists, primary genre, and number of streams as its six parameters with default arguments of “untitled”, “unknown”, 0, 1, “pop”, and 0 respectively – A copy constructor – A constructor that takes a constant reference to a SongRecording, a primary genre (with a default argument of “pop”), and a number streams (with a default argument of 0) as its three parameters – An overloaded assignment operator – A destructor – GetStreams() – Returns the number of streams – SetStreams(string) – Sets the title to any string that is at least 1 character long – AddStreams(int) – Increases the number of streams by the argument as long as the argument is non-negative. If the argument is negative, the data member should remain unchanged. – GetNumGenres() – Returns the number of genres – GetGenre(int) – This function should have a default argument of 1. It returns the name of the specified genre if the integer argument is between 1 and the number of genres, inclusive. If the integer argument is out of range, the function should return the string “out of bounds” – IsGenre(string) – Returns true if the string argument is one of the StreamingTrack’s genres, and false otherwise – AddGenre(string) – Adds the string argument to the StreamingTrack’s genres (updating the pointer data member and the number of genres data member) if the argument is not already in the list of genres. If the argument is already one of the track’s genres, the data members should remain unchanged – RemoveGenre(string) – Removes the string argument from the StreamingTrack’s genres (updating the pointer data member and the number of genres data member) if the argument is in the list of genres. If the argument is not one of the track’s genres, the data members should remain unchanged Initial testing of the StreamingTrack class Include your SongRecording.h, SongRecording.cc, StreamingTrack.h, and StreamingTrack.cc files in the same directory as all of the provided test files and makefile. Type the following commands for initial tests of the data members and functionality.. make testStreams make testAddGenre make testRemoveAndAddGenre make testIsGenre make testStreamingTrackConstructors1 make testStreamingTrackCopyConstructor make testStreamingTrackAssignment make testStreamingTrackBaseToDerivedConstructor You are encouraged to create additional, more rigorous tests! Additional Specifications – The definition of the SongRecording class must be written in a file named SongRecording.h – The implementation of the member functions for the SongRecording class must be written in a file named SongRecording.cc – The definition of the StreamingTrack class must be written in a file named StreamingTrack.h – The implementation of the member functions for the StreamingTrack class must be written in a file named StreamingTrack.cc – Both classes must be added to the csce240_programming_assignment_5 namespace. Classes not added to the csce240_programming_assignment_5 namespace will not be eligible for correctness points. – You will submit a zip file containing only SongRecording.h, SongRecording.cc, StreamingTrack.h, and StreamingTrack.cc to the assignment in Blackboard – The only standard library headers that may be included in your code are: iostream and string. Submissions that include other standard library headers will not be eligible for correctness points. – Source files must compile and run on a computer of the instructor’s choosing in the Linux lab (see your course syllabus for additional details). – Be sure to review the program expectations section of the course syllabus. Grade Breakdown Style SongRecording.h: 0.25 points Style SongRecording.cc: 0.25 points Style StreamingTrack.h: 0.25 points Style StreamingTrack.cc: 0.25 points Documentation: 1 point Clean compile of SongRecording.cc: 0.5 points Clean compile of StreamingTrack.cc: 0.5 points Passes instructor’s modified testTitle: 0.5 points Passes instructor’s modified testTrackLength: 0.5 points Passes instructor’s modified testArtist: 0.5 points Passes instructor’s modified testSoundRecordingConstructors1: 0.5 points Passes instructor’s modified testSoundRecordingCopyConstructor: 0.5 points Passes instructor’s modified testSoundRecordingAssignment: 0.5 points Passes instructor’s modified testStreams: 0.5 points Passes instructor’s modified testAddGenre: 0.5 points Passes instructor’s modified testRemoveAndAddGenre: 0.5 points Passes instructor’s modified testStreamingTrackConstructors1: 0.5 points Passes instructor’s modified testStreamingTrackCopyConstructor: 0.5 points Passes instructor’s modified testSoundRecordingAssignment: 0.5 points Passes instructor’s modified testStreamingTrackAssignment: 0.5 points Passes instructor’s modified testStreamingTrackBaseToDerivedConstructor: 0.5 points The penalty for late assignment submissions is 10% per day up to three days after the assignment due date. No assignment submissions will be accepted more that 3 days after the due date.

$25.00 View

[SOLVED] Csce 240 – programming assignment four

Purpose – Implement the following two classes Weight Create a Weight class that holds the value and units of a weight in private double and string data members, respectively. The class should allow for the units to be ounces, pounds, grams, or kilograms. The class will contain a constructor, a ConvertUnits member function, and accessor and mutator functions for the private data members. You will also need to overload the

$25.00 View

[SOLVED] Csce 240 – programming assignment three

Purpose Write, test, and use the four functions described below to read a text file containing a word search grid, display the grid, and find words within the grid. Functions Function 1 – ReadWordSearch Implement the ReadWordSearch function. This function reads a text file containing the characters into a double-subscripted character array with kSize rows and kSize columns. kSize is a constant variable set in word_search_functions.h. This function should return true if the character array is successfully populated, and false if not. Read over the pre-condition and post-condition comments in word_search_functions.h for more details. Function 2 – PrintWordSearch Implement the PrintWordSearch function. This function takes a doublesubscripted character array with kSize rows and kSize columns as an argument and outputs the characters at the standard output device (using cout) in a grid with a space between each column. Read over the pre-condition and postcondition comments in word_search_functions.h for more details. Function 3 – FindWordRight Implement the FindWordRight function. This function takes a double-subscripted character array with kSize rows and kSize columns, a string, and two integer references as arguments. The function will locate the first occurrence of the string in the array, written from left to right in a row in the array, and set the integer reference arguments to the starting position of the string. If the string appears in a row of the character array, the function returns true. If the string does not appear in a row in the array, the function returns false. Read over the pre-condition and post-condition comments in word_search_functions.h for more details. Function 4 – FindWordLeft Implement the FindWordLeft function. This function takes a double-subscripted character array with kSize rows and kSize columns, a string, and two integer references as arguments. The function will locate the first occurrence of the string in the array, written from right to left in a row in the array, and set the integer reference arguments to the starting position of the string. If the string appears in a row of the character array, the function returns true. If the string does not appear in a row in the array, the function returns false. Read over the pre-condition and post-condition comments in word_search_functions.h for more details. Function 5 – FindWordDown Implement the FindWordDown function. This function takes a double-subscripted character array with kSize rows and kSize columns, a string, and two integer references as arguments. The function will locate the first occurrence of the string in the array, written down in a column in the array, and set the integer reference arguments to the starting position of the string. If the string appears in a column of the character array, the function returns true. If the string does not appear in a column in the array, the function returns false. Read over the pre-condition and post-condition comments in word_search_functions.h for more details. Function 6 – FindWordUp Implement the FindWordUp function. This function takes a double-subscripted character array with kSize rows and kSize columns, a string, and two integer references as arguments. The function will locate the first occurrence of the string in the array, written up (from bottom to top) in a column in the array, and set the integer reference arguments to the starting position of the string. If the string appears in a column of the character array, the function returns true. If the string does not appear in a column in the array, the function returns false. Read over the pre-condition and post-condition comments in word_search_functions.h for more details. Function 7 – FindWordDiagonal Implement the FindWordDiagonal function. This function takes a doublesubscripted character array with kSize rows and kSize columns, a string, and two integer references as arguments. The function will locate the first occurrence of the string in the array, written diagonally from left to right in the array, and set the integer reference arguments to the starting position of the string. If the string appears on a diagonal in the character array, the function returns true. If the string does not appear on a diagonal in the array, the function returns false. Read over the pre-condition and postcondition comments in word_search_functions.h for more details. Example For the grid below: e c n e i c t p r o g r a m r g m a u z u c l m n o n a e b i a c w s i g r x t t v s t l t n y y u a r e o b x i e i o r b r h b k t m n w h a l w l b e a l s c a w e c n e i c s p r o g r a m q x z FindWordRight should find “program” at position 9,0 FindWordLeft should find “science” at position 8,9 FindWordDown should find “guitar” at position 1,0 FindWordUp should find “meeting” at position 9,6 FindWordDiagonal should find “nine” at position 2,4 Specifications – All output should be directed to the standard output device using cout. – The prototypes for the FindWordRight, FindWordLeft, FindWordDown, FindWordUp, and FindWordDiagonal functions are included in word_search_functions.h. Do not change the contents of the header file, except to modify the constant kSize, when testing your functions for different size word search grids. You must implement these functions in word_search_functions.cc, and word_search_functions.cc must include word_search_functions.h – You will submit word_search_functions.cc to the assignment in Blackboard. – Source files must compile and run on a computer of the instructor’s choosing in the Linux lab (see your course syllabus for additional details). Testing A sample text file, grid.txt, containing the example word search grid shown above, a sample driver to test your functions program3.cc, and a makefile have been provided. You should ensure that your functions find the words in the positions provided in the examples. You should search for words that do not appear in the grid to ensure that the words are not found and your functions do not crash. You are encouraged to test your functions with additional grids and search words. Your functions will be graded using the included program3.cc with modifications to kSize and the grid.txt input file. Grade Breakdown Style: 1 point Documentation: 1 point Clean compilation: 1 point ReadWordSearch passes instructor’s tests: 1 point PrintWordSearch passes instructor’s tests: 1 point FindWordRight passes instructor’s tests: 1 point FindWordLeft passes instructor’s tests: 1 point FindWordDown passes instructor’s tests: 1 point FindWordUp passes instructor’s tests: 1 point FindWordDiagonal passes instructor’s tests: 1 point The penalty for late program submissions is 10% per day, with no program being accepted after 3 days.

$25.00 View

[SOLVED] Csce 240 – programming assignment two

Program Purpose – Implement the functions described below IsSquare – Function that takes an integer argument and returns whether or not the argument is a perfect square (is equal to an integer squared). For example, IsSquare(4) should return true, and IsSquare(5) should return false. IsPerfect – Function that takes an integer argument and returns whether or not the argument is a perfect number. A perfect number is a positive integer that is equal to the sum of all of its proper divisors. For example, IsPerfect(6) should return true, because the proper divisors of 6 are 1, 2, and 3, and 1 + 2 + 3 = 6. IsPerfect(12) should return false, because the proper divisors of 12 are 1, 2, 3, 4, and 6, and 1 + 2 + 3 + 4 + 6 is not equal to 12. IsVowel – Function that takes a character and a bool as arguments. If the character argument is a vowel, the function should return true. If the character argument is not a vowel, the function should return false. The bool argument determines whether (true) or not (false) the letter y should be considered a vowel. The bool parameter should have a default value of true. For example, IsVowel(‘y’, false) should return false. IsVowel(‘y’) should return true. IsVowel(‘E’) should return true. IsVowel(‘X’) should return false. IsVowel(‘u’, false) should return true. IsConsonant – Function that takes a character and a bool as arguments. If the character argument is a consonant, the function should return true. If the character argument is not a consonant, the function should return false. The bool argument determines whether (true) or not (false) the letter y should be considered a consonant. The bool parameter should have a default value of true. For example, IsConsonant(‘y’, false) should return false. IsConsonant(‘y’) should return true. IsConsonant(‘E’) should return false. IsConsonant(‘X’) should return true. IsConsonant(‘g’, false) should return true. ToDigit – Function that takes a character argument and returns the integer equivalent of that argument if the argument is ‘0’, ‘1’, ‘2’, ‘3’, ‘4’, ‘5’, ‘6’, ‘7’, ‘8’, or ‘9’. If the argument is not a digit character, the function should return 0. Range – Function that takes two integer variables as arguments and returns the distance between the variable’s values. Once the function call is complete, the variable sent for the first argument should hold the smaller of the two values, and the variable send for the second argument should hold the larger of the two value. For example, if x = 3 and y = 7, Range(x, y) should return 4. And after the function call is complete, x will still hold 3, and y will still hold 7. If a = 9 and b = 1, Range(a, b) should return 8. And after the function call is complete, a should hold 1, and b should hold 9. DigitInPosition – Function that takes a double and an integer as its two arguments. The integer argument is the position of the digit in the double to be returned. The position is relative to the digit in the ones place, which is position 0. So, position -1 is 1 position to the left of the ones place, i.e. the tens place. And position 2 is 2 positions to the right of the ones place, which is the hundredths place. For example, DigitInPosition(185.34, 0) should return 5 since the 5 is zero positions away from the ones place. DigitInPosition(185.34, -2) should return 1 since the 1 is two positions to the left of the ones place. DigitInPosition(185.34, 1) should return 3 since the 3 is one position to the right of the ones place. Additional Specifications – All function prototypes must be contained in a file named program2functions.h – All function implementations must be written in a file named program2functions.cc – You will submit your program2functions.h and program2functions.cc files to the assignment in Blackboard. – Programs must compile and run on a computer of the instructor’s choosing in the Linux lab (see your course syllabus for additional details). – Be sure to review the program expectations section of the course syllabus. Initial Testing Initial tests for the functions are attached to the assignment in Blackboard. A makefile has been included to run your functions with the sample tests. To use the makefile, ensure that your program2functions.h and program2functions.cc files and all of the files attached to the assignment are in the same directory. Your program will be graded using this same method with modified tests. The commands to run the sample tests are given below: make testIsSquare make testIsPerfect make testIsVowel make testIsConsonant make testToDigit make testRange make testDigitInPosition You are strongly encouraged to create additional, more rigorous tests. Grade Breakdown Style: 1 point Documentation: 1 point Clean compile/link of program2functions.cc: 1 point IsSquare passes instructor’s tests: 1 point IsPerfect passes instructor’s tests: 1 point IsVowel passes instructor’s tests: 1 point IsConsonant passes instructor’s tests: 1 point ToDigit passes instructor’s tests: 1 point Range passes instructor’s tests: 1 point IsSquare passes instructor’s tests: 1 point The penalty for late assignment submissions is 10% per day up to three days after the assignment due date. No assignment submissions will be accepted more than 3 days after the due date.

$25.00 View

[SOLVED] ENGI 45560 MSc Research and Development Project Group Presentation 2024-2025SPSS

DEPARTMENT OF ENGINEERING COURSEWORK Module Code:                  Academic Year:                    Term: ENGI 45560                     2024-2025                            Epiphany Title: MSc Research and Development Project: Group Presentation (Formative) Time Required: It is expected that you should spend approximately 20 hours. Deadline(s) for submission: Oral Presentation: last supervision meeting in the Epipihany term. Submission of Presentation: Monday 24 March 2025, 14:00. Date for feedback: Verbal feedback during meeting. Submission instructions: Presentation to be submitted to Learn Ultra by the deadline given above. Format: Each group will make a presentation of their work to their tutor(s) during the session (see above).  After the general presentation covering the overarching research area, each student discusses their proposed individual projects. Students must attend these sessions as scheduled. Presentations to be saved in pdf format only. Penalties for non-compliance: N/A Late submission: Due to the timetabled nature of these sessions, it is not possible to accept late submissions. Any delays or other issues should be reported to the Engineering Learning and Teaching team as they arise. Academic Integrity Guidance: The Department of Engineering considers any attempt by a student to gain an unfair academic advantage through engaging in acts of academic misconduct ultimately diminishes the value of the degree sought and indicates a fundamental dishonestly which disrespects members of the learning community in the department. All potential incidents of suspected academic dishonesty shall be thoroughly investigated in accordance with the Learning and Teaching Handbook, Section 6.2.4: Academic Misconduct (sharepoint.com). Use of Generative AI Use of generative AI (gAI) and related technologies is only permitted for improving the readability of text and improving the efficiency of computer code. Use of generative AI (gAI) and related technologies should be compliant with our policy document entitled "Student Guidance on the Use of Generative Artificial Intelligence and Related Technology for the Department of Engineering". Any use of gAI or related technologies should be detailed in an acknowledgement section within your coursework submission document. AHEP Learning Outcomes Assessed: The Engineering Council sets the overall requirements for the Accreditation of Higher Education Programmes (AHEP) in engineering, in line with the UK Standard for Professional Engineering Competence (UK-SPEC). This assignment has been designed to assess the following AHEP Learning Outcomes: M1.  Apply a comprehensive knowledge of mathematics, statistics, natural science and engineering principles to the solution of complex problems. M2.  Formulate and analyse complex problems to reach substantiated conclusions. M3.  Select and apply appropriate computational and analytical techniques to model complex problems, discussing the limitations of the techniques employed M4.  Select and critically evaluate technical literature and other sources of information to solve complex problems. M16. Function effectively as an individual, and as a member or leader of a team. Evaluate effectiveness of own and team performance. M17.  Communicate effectively on complex engineering matters with technical and non-technical audiences, evaluating the effectiveness of the methods used. Instructions to Candidates: A short oral presentation will be carried out in the last session of Epiphany term. More specific details will be provided during the tutorial sessions. Presentations to be saved in pdf format and uploaded to Learn Ultra by the deadline, Monday 24 March 2025. Questions relating to submission arrangements should be directed to: [email protected]. Questions relating to the assignment should be directed to: Your Project Supervisor or Dr Stefano Giani[email protected]. Revision:

$25.00 View

[SOLVED] STATS 726 Time Series SEMESTER 2 2018

STATS 726 STATISTICS Time Series SEMESTER 2, 2018 1 a Explain the following terms in the context of univariate time series. Use your own words since simply copying from the notes will earn no marks. i (2 marks) Weakly stationary time series. ii (2 marks) Autocorrelation function (ACF) at lag-h. iii (2 marks) Partial autocorrelation function (PACF) at lag-h. b Figures 1–2 (see pages 6–7) give time plots and ACF plots corresponding to five different time series, respectively. i (5 marks) Briefly explain the time series components that you can observe in each time plot. ii (4 marks) Match each time plot on page 6 with one of the ACF plots shown in page 7. For example, time plot (4) and ACF plot (E) is a match. c Let {Xt} be a random walk process with a drift defined as Xt = δ + Xt−1 + εt ,        t ≥ 1, where δ is a real-valued constant, X0 = 0 and {εt} ∼ WN(0, σ2). i (4 marks) Show that {Xt} is not weakly stationary. ii (3 marks) Let ρX(r, s) = Corr(Xr, Xs) be the autocorrelation function of {Xt} at time points r and s where r, s ∈ {1, 2, . . . }. Prove that iii (4 marks) Suggest a transformation of the time series {Xt} such that the resulting time series (say {Yt}) is weakly stationary. Show that {Yt} is weakly stationary.    [26 marks] 2 Let {Xt}t∈Z be an invertible MA(1) process with a non-zero mean µ, defined by Xt − µ = θεt−1 + εt ,              {εt}t∈Z ∼ WN(0, σ2 ).               (I) a (2 marks) State the autocovariance function of {Xt} at lag-h for all h ∈ Z. b (4 marks) For n ≥ 2, write the expression of the best linear predictor of Xn based on Xn−1, Xn−2, . . . , X1 in terms of µ, θ and {Xn−1, Xn−2, . . . , X1}. Note: You are not required to simplify the matrix inversion. c Let X1, X2, X4 and X5 be four random variables from the MA(1) process de-fined in Eq. (I). i Find the best linear estimator of the missing value X3 in terms of (A) (4 marks) X1 and X2. (B) (3 marks) X4 and X5. (C) (6 marks) X1, X2, X4 and X5. Hint: Let A ∈ R r×r , B ∈ R r×s , C ∈ R s×r and D ∈ R s×s . If A, D and D − CA−1B are non-singular, then ii (9 marks) Compute the mean squared error for each of the estimators in (A)–(C).              [28 marks] 3 Let {Zt}t∈Z be random variables satisfying Zt = φ1Zt−1 + φ2Zt−2 + εt ,                 (II) where φ1, φ2 ∈ R and {εt}t∈Z ∼ IID N (0, σ2 ). a (5 marks) Assuming that      Zt = 0        for all t ≤ 0 and Zt = 0        for all t > n, write the identity in Eq. (II) for t = 1, 2, . . . , n + 2. Then re-write the n + 2 equations in the following equivalent matrix form. y = Xφ + ε, where y = (Z1, Z2, . . . , Zn, 0, 0)> , φ = (φ1, φ2) > and (·) > denotes transposi-tion. b (6 marks) Assuming that the entries of matrix X are fixed, use the result in part (a) to show that the ordinary least squares (OLS) estimator of vector φ is: (III) where ˆρ(h) denotes the sample autocorrelation function of {Zt} at lag-h. Note: You do not need to derive the first-order conditions of OLS estimation. c (3 marks) Using the properties of the OLS estimator, show that the estimate of the variance-covariance matrix for φˆ in Eq. (III) is given by where ˆγ(0) is the sample autocovariance function of {Zt} at lag-0 and ˆσ 2 is the unbiased estimate of σ 2 . d From a time series of length n = 144, we find that ˆγ(0) = 27.418, ˆρ(1) = −0.620, ρˆ(2) = 0.897 and ˆσ 2 = 5.257. i (3 marks) Compute the OLS estimate of (φ1, φ2). ii (6 marks) Construct the 95% confidence intervals for φ1 and φ2. Com-ment whether or not these coefficients are statistically different from zero. Justify your answer. Note: The 95% central probability region of N (0, 1) is from −1.96 to 1.96.          [23 marks] 4 Figure 3 (see page 8) shows the time plot of quarterly European retail trade index from 1996 to 2011 covering wholesale and retail trade, and repair of motor vehicles and motorcycles. a (1 mark) Describe the time series components that you can observe in Figure 3. b (2 marks) Is this time series weakly stationary? Briefly justify your answer. c (3 marks) Figure 4 (see page 9) shows the time plot, ACF and PACF plots of • original time series • non-seasonally differenced time series • seasonally differenced time series • both non-seasonally and seasonally differenced time series. Using this figure, find an appropriate differencing which yields a stationary time series. Justify your selection. d (6 marks) By examining the ACF and PACF plots corresponding to your selection in part (c), suggest a seasonal ARIMA model which is appropriate for this data set. Give reasons for your selection. e (2 marks) Based on your choice of differencing in part (c) refer either Table 1 or Table 2 or Table 3 (see pages 10–12) and select a model which is best according to the AICc (corrected AIC) value. f (3 marks) Discuss briefly few residual diagnostics that can be performed to check the adequacy of the model selected in part (e). g (6 marks) Write the difference equation for the model you have selected in part (e) in terms of the estimated coefficients given in Table 1, 2 or 3. Write the equations which are needed to compute the forecasts for the next 2 quarters.          [23 marks]

$25.00 View

[SOLVED] Project 3

Project 3 How to Succeed on this Project 1. Read the entirety of this specification in detail. It contains a lot of information that will make the project go more smoothly in you take the time to understand it before starting the project. 2. Know the purpose of each file in the starter code. You will not need to modify any files to complete the project, but you should read this specification to understand why the other files are present. 3. Expect to get stuck, and exercise patience and persistence. This project does not involve writing a large quantity of code. Rather, it involves solving a series of "puzzle" problems that will take time and thinking to solve. Do not expect the solutions to these puzzles to be immediately clear to you. Instead, you will initially be stuck and will have to think through them, perhaps using a pen and paper to work through different examples. Getting stuck like this is a normal part of the learning process in STEM subjects. We are happy to help in office hours but will not give out answers -- we can only point you in the right direction or suggest helpful examples to consider. 4. Start early. Give yourself time to get stuck, discover insights about the puzzles, and overcome obstacles. It can be hard to think creatively about solutions to programming problems like those in this project when you feel the pressure of an imminent deadline. 5. If you have questions, your best option is to ask in a public Piazza post. This gets your question in front of as many people as quickly as possible, and also lets others benefit later by seeing the answer to your question. 6. Familiarize yourself with the late submission policy detailed in the syllabus so that you are not caught off-guard. No submissions are accepted more than 48 hours after the deadline. Extensions are generally not granted for projects except in the case of a documented and acute emergency. 7. The two parts of this project are independent, so you should feel free to switch between them. If you get stuck in Part 1, try making some progress on Part 2, and vice versa. Introduction This project consists of two parts. In the first part, you will (again) solve a series of programming problems involving bitwise operations and data representations. In the second part, you will (again) use a debugger to run and inspect the workings of a puzzle program to reverse engineer it and deduce the input values needed to run the program successfully to completion. In Part 1 of this assignment, you will write assembly code involving these operations. You will do this by solving a series of programming "puzzles." Debugging code is also a critical aspect of real programming that is greatly aided through use of a debugger tool. In Part 2 of this project, you will use the GNU Debugger, gdb, to work through a puzzle program requiring specific inputs to pass its sequence of "phases." Grading Criteria Credit for this assignment will be awarded based on two categories: Automated Testing of Bitwise Puzzles (26%): The starter code includes two programs that will test your bitwise puzzle solutions. The first program checks that your code adheres to the requirements stated below, while the second program runs your puzzle solutions against a variety of inputs. We will use these same programs when autograding your work. Bomb Defusing (74%): You will follow the instructions on this page for obtaining and defusing your binary bomb. Scoring for the binary bomb is based on number of phases defused, and is handled automatically as you defuse it. Starter Code Download the zip file linked at the top of this page to obtain the starter code for this project. You should see the following files. You may only modify the files marked "Edit" under the "Purpose" column below. The autograder will use the starter versions of all other files when grading your work. File Purpose Notes Makefile Build and Test Build file to compile code and run test cases for both parts bitwise/bits_impl .h Provided Header file for solutions to bitwise puzzles bitwise/bits .s EDIT Solutions to bitwise problems for part 1. We have defined a procedure for each problem and you need to fill in each assembly procedure's body with your solution. bitwise/bits_test.h Testing Testing code for bitwise puzzle problems bitwise/bits_test .c Testing Testing code for bitwise puzzle problems bitwise/btest .c Testing Testing code for bitwise puzzle problems bitwise/check_bitwise Testing Testing code for bitwise puzzle problems bitwise/cc_check Testing Testing code for bitwise puzzle problems bitwise/tests .c Testing Testing code for bitwise puzzle problems bitwise/ishow .c Utility Helpful program for showing integer representations bitwise/fshow .c Utility Helpful program for showing float representations bitwise/Makefile Build and Test Automates compiling and testing for part 1 only Part 1: Bitwise Puzzles (now in assembly!) Read the material below and the comments at the top of bits.s to understand how to complete this part of the project. The first part of the project focuses on the files in the bitwise directory. We recommend that you work within this subdirectory of the starter code for the duration of this part of the project (e.g., by using cd in your terminal). The first thing you will likely want to do is run the make command within this subdirectory to compile the starter code and the useful utilities it provides (described below). Note: If you wish to compile this code in your own Linux environment rather than the CSE Labs machines, you will need to install 32-bit variants of the standard C libraries. With Ubuntu, you can do this with the following command: sudo apt install gcc-multilib Your task is to fill in the skeleton code in the bits.s file with solutions to 10 bitwise puzzle problems. As before, you can only use straightline assembly code for the integer-related puzzles (i.e., no jumps or calls). Other than those two flow control instructions, you may use any instruction introduced in the book through chapter 3.7. You must respect the register conventions: Each function's input arguments will be stored in registers %edi, %esi, ..., etc. Each function's return values will be returned by storing it in %eax. If you want to use a callee-save register, it will be your job to save the value that was there, and restore that value when you are finished. Also, you are not allowed to use any immediate values larger than 8 bits (e.g., you can use $0xFF but not $0xFFF). Note: There is now a single floating point-related puzzle. On this puzzle, the restrictions are lifted: You may use conditionals, jumps and large constants. The Puzzles The puzzles that you will be solving in bits.s are described below, in the same order as their appearance in the provided code. The puzzles are ordered roughly from least difficult to most difficult. The "Rating" column gives the difficulty rating (which also corresponds to the number of points awarded for solving the puzzle). The "Max Ops" column gives the maximum number of operations you are allowed to use in your solution. You may also want to look at the contents of bits_tests.c to see reference functions that express correct behavior. of your functions. Name Description Rating isZero Return 1 if x is 0, 0 otherwise 1 bitNor Implement bitwise nor (=not or) 1 distinctNegation returns 1 if x != -x 1 dividePower2 Compute x/(2^n), for 0

$25.00 View

[SOLVED] Home Assignment 3

Home Assignment 3 Problem 1 The pharmaceutical company PhotonicSensing AB is designing a photonic chip sensor for de-tection of antibodies from saliva samples.  It has developed a chemical that has very interesting properties:  antibodies can adhere with high efficiency to the material, resulting in a refractive index change in proportion to the antibody concentration, following a simple linear relation n = n0 + αN,                                                               (1) where n0  is the refractive index of the material in absence of antibodies, N is the number of antibodies that have been adhered, and α = 10-12  is a proportionality constant.  As an example, if 1 000 000 antibodies bind to the material, the refractive index changes by 10-6 .  For simplicity, we will assume that n0  takes the same value as that of silica. The working function of the sensor is described in Figure 1 below. The material sensitive to the antibodies is used as cladding in a buried waveguide structure.  This waveguide is used to build an optical microresonator designed to operate under critical coupling condition.  A laser at 1300 nm is tuned to one longitudinal mode and the chip is impregnated with the saliva from a patient. The antibodies cause a change in refractive index, resulting in a shift of the longitudinal mode, which can be detected as an increase in output power.   The intrinsic quality factor is measured to be Qi  = 106 . Figure  1 :   Cross-section  geometry  (left)  of  buried  waveguide  geometry  with  the  chemical for  antibody adhesion used as cladding.  When this waveguide is used in a critically coupled resonator (middle) it gen-  erates a set of longitudinal modes.  A laser tuned to one of the longitudinal modes will become attenuated in power (right) .  However,  the presence  of antibodies will modify the refractive index of the material, resulting in a phase shift and consequently a change in the frequency location of the longitudinal mode. The laser will thus experience less attenuation.  The changes in power can be mapped to the number of antibodies that have been bound to the resonator. a)  Engineer the cross-section of the waveguide core geometry of the ring so that it provides the maximum change in effective index for the fundamental mode when the antibodies bind. Consider the range of waveguide widths [500 - 1000] nm and the waveguide height [100 - 300] nm. The layer of the sensitive material is 2 µm, and the lower cladding 3 µm.  Justify your choice of geometry and discuss your results in terms of the optical confinement of the fundamental mode. Notes: •  The two cladding layers are so thick that they can be assumed to fill the simulation area in Lumerical. •  There is no need to perform any calculation on the ring geometry for this part of the problem. b)  Assume that the resonator is designed with with radius r = 200µm.  What order is the mode that is closest to the laser frequency at 1300nm? c)  How much will the resonance frequency of the mode shift if one million antibodies bind to the chemical on top of the resonator? d)  Suggest at least two ways to improve the sensitivity of the antibody sensor.  Explain why and how those improvements work. Problem 2 Mach-Zehnder interferometers (MZIs) can be adapted to operate as wavelength multiplexers and demultiplexers.  Figure  2 shows a schematic of a simple 1x2 wavelength demultiplexer.  Ignore the dispersion of the bulk materials and the waveguide. a)  Design the cross-section geometry of the waveguide,  the length difference  ∆L between the arms,  and the  2x2 couplers  (i.e.,  the  gap  between the waveguides and the coupler length) so that the MZI works as a 2-λ demultiplexer with frequency spacing of 100GHz for wavelengths in the region of 1300nm.  Show the transfer function for either port as a function of optical frequency, i.e., plot the normalized transmitted power for either the top or bottom port as a function of input frequency. b)  Silicon nitride, which is used as the core material of the waveguide, has a thermo-optic coefficient of 2 × 10-6 K-1 .  This means that the refractive index changes by two parts per million for a variation in temperature of one Kelvin.  How much will the frequency spacing change if the above device is placed close to a computer chip in a datacenter, where the temperature can change from 25 。C to 80 。C?  By how much does the transmitted wavelength λ 1  change when the temperature increases from 25 。C to 80 。C?    Figure 2:  Cross-section  of the  waveguide  (left) and a Mach-Zehnder interferometer (right) operating as a demultiplexer for light with wavelengths λ1 ,  λ2 . Problem 3 a)  Using Lumerical MODE, design an inverse taper coupler with more than 80% coupling efficiency when coupling light from a standard single-mode optical fiber SMF-28 at 1500nm into a single-mode silicon waveguide core with height h = 380nm and width w = 380nm. Assume the waveguide has silica cladding. b)  How much can the waveguide and fiber be mismatched before the coupling efficiency drops below 70%?  Plot the coupling efficiency vs.  fiber misalignment  (choose one direction for the misalignment).

$25.00 View

[SOLVED] ANTH 108 Field Report on Barbadoes Street Cemetery

ANTH 108 Field Report on Barbadoes Street Cemetery 03 april 2025 1.  Introduction 1.1. The purpose of this report is to provide information that will assist in the interpretation of selected gravestones at Barbadoes Street Cemetery. This includes describing: · the history of the site; · the social and cultural context in which the cemetery was established; · the meaning of the different elements of the selected gravestones, and the relationship of those elements to society at the time; · the place of religion and ideas about afterlives; and · the message or symbolism of the gravestone. 1.2. The report is based on close readings of your field data, the various heritage reports and assessments (including those by the Christchurch City Council), as well as relevant anthropological and historical literature related to ‘deathways’. 1.3. The brief is to provide historical and cultural context for an analysis of five selected gravestones, to attend to meanings and connections, and to speak to questions of faith and afterlives. 2. Historical and Cultural Contexts in which Barbadoes Street was established 2.1. [Kemp’s Deed – the Canterbury Association – Barbadoes Street opening date and history – the nature of the site] 250 words 2.2. [the wider context: place Barbadoes Street in relation to revolutionary changes which led to a new regime of the dead in the nineteenth century – necro-nominalism (naming the dead) – the rise of the cemetery] 250 words 3. Interpretation of selected gravestones 3.1. [Names] [location] [Insert text here] 200 words 3.2. [Names] [location] [Insert text here] 200 words 3.3. [Names] [location] [Insert text here] 200 words 3.4. [Names] [location] [Insert text here] 200 words 3.5. [Names] [location] [Insert text here] 200 words 4. Appendix A: Visual Aids to Interpretation [Insert any cemetery maps and historical photographs here. Remember to include captions and source] 5. Appendix B: Visual Aids to Individual Graves [Insert photographs of the selected gravestones here. Remember to include captions and source] 5.1 5.2 5.3 5.4 5.5    

$25.00 View